/* ═══════════════════════════════════════════════════════════════
   DIGITAL GROWTH ECOSYSTEM SECTION
   ═══════════════════════════════════════════════════════════════ */

/* ── Section wrapper ─────────────────────────────────────────── */
.ecosystem-section {
  position: relative;
  padding-block: clamp(4rem, 8vw, 7rem);
  overflow: hidden;
  background: var(--color-bg);
}

.ecosystem-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(37,99,235,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(37,99,235,0.04) 0%, transparent 60%);
  pointer-events: none;
}

/* ── Section header ──────────────────────────────────────────── */
.ecosystem__header {
  text-align: center;
  max-width: 740px;
  margin: 0 auto var(--space-14, 3.5rem);
}

.ecosystem__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(37,99,235,0.1);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  margin-bottom: var(--space-5);
}

.ecosystem__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: var(--space-5);
}

.ecosystem__title em {
  font-style: normal;
  color: var(--color-primary);
}

.ecosystem__subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.75;
  max-width: 60ch;
  margin: 0 auto;
}

/* ── Ecosystem graphic wrapper ───────────────────────────────── */
.ecosystem__graphic-wrap {
  position: relative;
  max-width: 1100px;
  margin: 0 auto var(--space-14, 3.5rem);
}

.ecosystem__glow {
  position: absolute;
  inset: -60px;
  background: radial-gradient(ellipse 70% 50% at 50% 50%, rgba(37,99,235,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.ecosystem__img-frame {
  position: relative;
  z-index: 1;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(37,99,235,0.18);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 24px 80px rgba(0,0,0,0.5),
    0 0 60px rgba(37,99,235,0.08);
  background: rgba(10,10,14,0.95);
  backdrop-filter: blur(2px);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.ecosystem__img-frame:hover {
  box-shadow:
    0 0 0 1px rgba(37,99,235,0.3),
    0 32px 100px rgba(0,0,0,0.55),
    0 0 80px rgba(37,99,235,0.14);
  transform: translateY(-2px);
}

.ecosystem__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
}

/* ── Hotspot overlay ─────────────────────────────────────────── */
.ecosystem__hotspots {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  pointer-events: all;
  cursor: pointer;
}

.hotspot__pulse {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(37,99,235,0.25);
  border: 2px solid rgba(37,99,235,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.hotspot__pulse::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(37,99,235,0.35);
  animation: pulse-ring 2.2s ease-out infinite;
}

.hotspot__pulse::after {
  content: '+';
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.hotspot:hover .hotspot__pulse,
.hotspot.active .hotspot__pulse {
  background: rgba(37,99,235,0.6);
  border-color: #3b82f6;
  transform: scale(1.15);
}

@keyframes pulse-ring {
  0%   { opacity: 0.8; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(1.7); }
  100% { opacity: 0;   transform: scale(1.7); }
}

/* ── Hotspot tooltip ─────────────────────────────────────────── */
.hotspot__tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: rgba(12,14,22,0.97);
  border: 1px solid rgba(37,99,235,0.3);
  border-radius: 12px;
  padding: 14px 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateX(-50%) translateY(6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  z-index: 10;
}

.hotspot:hover .hotspot__tooltip,
.hotspot.active .hotspot__tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hotspot__tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(37,99,235,0.3);
}

.hotspot__tooltip h4 {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 5px;
  font-family: var(--font-display);
}

.hotspot__tooltip p {
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  line-height: 1.55;
  margin: 0;
}

/* ── Capabilities grid ───────────────────────────────────────── */
.ecosystem__caps {
  padding-block: clamp(3rem,6vw,5rem);
  background: rgba(255,255,255,0.015);
  border-top: 1px solid var(--color-border-subtle);
  border-bottom: 1px solid var(--color-border-subtle);
}

.ecosystem__caps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-10);
}

.cap-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: var(--space-6);
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
  cursor: default;
}

.cap-card:hover {
  border-color: rgba(37,99,235,0.35);
  background: rgba(37,99,235,0.05);
  transform: translateY(-2px);
}

.cap-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(37,99,235,0.15);
  border: 1px solid rgba(37,99,235,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  font-size: 18px;
}

.cap-card__title {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-text);
  font-family: var(--font-display);
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
}

.cap-card__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cap-card__list li {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.4;
}

.cap-card__list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
  opacity: 0.7;
}

/* ── Growth Journey Timeline ─────────────────────────────────── */
.ecosystem__timeline {
  padding-block: clamp(3.5rem, 7vw, 6rem);
}

.ecosystem__timeline-track {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: var(--space-12);
  position: relative;
  justify-content: center;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 200px;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-step.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-step__connector {
  position: absolute;
  top: 28px;
  left: calc(50% + 28px);
  right: calc(-50% + 28px);
  height: 2px;
  background: linear-gradient(90deg, rgba(37,99,235,0.5), rgba(37,99,235,0.15));
}

.timeline-step:last-child .timeline-step__connector { display: none; }

.timeline-step__bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(37,99,235,0.12);
  border: 2px solid rgba(37,99,235,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 900;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
  transition: background 0.25s, border-color 0.25s, transform 0.25s;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.timeline-step:hover .timeline-step__bubble {
  background: rgba(37,99,235,0.25);
  border-color: var(--color-primary);
  transform: scale(1.1);
}

.timeline-step__body {
  text-align: center;
  padding: 0 var(--space-2);
}

.timeline-step__label {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-text);
  font-family: var(--font-display);
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.timeline-step__desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* ── Business Outcomes ───────────────────────────────────────── */
.ecosystem__outcomes {
  padding-block: clamp(3rem, 6vw, 5rem);
  background: rgba(255,255,255,0.015);
  border-top: 1px solid var(--color-border-subtle);
}

.outcomes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-10);
}

.outcome-card {
  padding: var(--space-7);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  text-align: center;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease, border-color 0.25s, background 0.25s;
}

.outcome-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.outcome-card:hover {
  border-color: rgba(37,99,235,0.3);
  background: rgba(37,99,235,0.05);
  transform: translateY(-3px) !important;
}

.outcome-card__icon {
  font-size: 28px;
  margin-bottom: var(--space-3);
  display: block;
}

.outcome-card__title {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-text);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

/* ── Ecosystem CTA ───────────────────────────────────────────── */
.ecosystem__cta {
  margin-top: clamp(3rem, 6vw, 5rem);
  padding: clamp(2.5rem, 5vw, 4rem);
  background: rgba(37,99,235,0.06);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ecosystem__cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37,99,235,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.ecosystem__cta h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  position: relative;
}

.ecosystem__cta p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin: 0 auto var(--space-7);
  line-height: 1.7;
  position: relative;
}

.ecosystem__cta-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

/* ── Scroll-reveal base ──────────────────────────────────────── */
.eco-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.eco-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .ecosystem__caps-grid { grid-template-columns: repeat(2, 1fr); }
  .outcomes-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile Ecosystem Icon Grid (replaces infographic on mobile) ── */
/* Hidden on desktop, activated in @media (max-width:768px) below */
.ecosystem__mobile-grid { display: none; }
.eco-mobile-grid { display: none; }

/* Base styles (always applied when visible) */
.eco-mobile-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s;
}
.eco-mobile-item:hover {
  border-color: rgba(37,99,235,0.3);
  background: rgba(37,99,235,0.05);
}
.eco-mobile-item__icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(37,99,235,0.14);
  border: 1px solid rgba(37,99,235,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.eco-mobile-item__label {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

/* ── Accordion for caps grid on mobile ── */
.cap-card--accordion .cap-card__body {
  display: none;
  margin-top: 0.625rem;
  padding-top: 0.625rem;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.cap-card--accordion.open .cap-card__body {
  display: block;
}
.cap-card--accordion .cap-card__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 0.5rem;
}
.cap-card--accordion .cap-card__chevron {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease, background 0.2s;
}
.cap-card--accordion.open .cap-card__chevron {
  transform: rotate(180deg);
  background: rgba(37,99,235,0.2);
  border-color: rgba(37,99,235,0.3);
}

@media (max-width: 768px) {
  /* Section padding — tighter on mobile */
  .ecosystem-section { padding-block: 1.5rem 2rem; }
  .ecosystem__caps  { padding-block: 2rem; }
  .ecosystem__timeline { padding-block: 2.5rem; }
  .ecosystem__outcomes { padding-block: 2rem; }
  .ecosystem__cta { padding: 2rem 1.25rem; border-radius: 16px; }

  /* Header spacing */
  .ecosystem__header { margin-bottom: 1.5rem !important; }
  .ecosystem__title  { font-size: clamp(1.4rem, 5vw, 2rem) !important; margin-bottom: 0.6rem; }
  .ecosystem__subtitle { font-size: 0.875rem; }

  /* Infographic on mobile — full-width, horizontally scrollable */
  .ecosystem__mobile-grid { display: none !important; }
  .ecosystem__graphic-wrap {
    margin-bottom: 1.25rem;
    /* Allow horizontal scroll so user can pan the infographic */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px;
  }
  .ecosystem__img-frame {
    min-width: 460px;
    border-radius: 14px;
  }
  .ecosystem__img {
    width: 100%;
    min-width: 460px;
    border-radius: 12px;
  }
  /* Hide hotspot pins — too small to be useful at this scale */
  .ecosystem__hotspots { display: none !important; }

  /* FIX 3: Caps grid on mobile — 2 columns, compact cards */
  .ecosystem__caps-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
  }
  .cap-card {
    padding: 0.875rem;
    border-radius: 12px;
  }
  .cap-card__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 0.375rem;
    flex-shrink: 0;
  }
  .cap-card__title { font-size: 0.75rem; margin-bottom: 0.375rem; }
  .cap-card__list  { gap: 4px; }
  .cap-card__list li { font-size: 0.68rem; gap: 5px; line-height: 1.35; }
  .cap-card__list li::before { width: 4px; height: 4px; }

  /* Outcomes grid — 2×4, small cards */
  .outcomes-grid { grid-template-columns: repeat(2, 1fr); gap: 0.625rem; }
  .outcome-card  { padding: 1rem 0.75rem; border-radius: 12px; }
  .outcome-card__icon  { font-size: 22px; margin-bottom: 0.375rem; }
  .outcome-card__title { font-size: 0.75rem; }

  /* Timeline — vertical stacked */
  .ecosystem__timeline-track {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .timeline-step {
    flex-direction: row;
    max-width: 100%;
    width: 100%;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.25rem;
  }
  .timeline-step__connector {
    position: absolute;
    top: 56px;
    left: 27px;
    right: auto;
    width: 2px;
    height: calc(100% - 28px);
    background: linear-gradient(180deg, rgba(37,99,235,0.5), rgba(37,99,235,0.1));
  }
  .timeline-step:last-child { padding-bottom: 0; }
  .timeline-step__bubble   { flex-shrink: 0; margin-bottom: 0; width: 48px; height: 48px; font-size: 0.8rem; }
  .timeline-step__body     { text-align: left; padding: 0.6rem 0 0; }
  .timeline-step__label    { font-size: 0.8rem; }
  .timeline-step__desc     { font-size: 0.72rem; }

  /* Hotspots — hidden on mobile (infographic is hidden) */
  .ecosystem__hotspots { display: none; }

  /* CTA */
  .ecosystem__cta h3 { font-size: 1.35rem; }
  .ecosystem__cta p  { font-size: 0.875rem; margin-bottom: 1.25rem; }
  .ecosystem__cta-actions { flex-direction: column; align-items: center; gap: 0.75rem; }
  .ecosystem__cta-actions .btn { width: 100%; max-width: 320px; justify-content: center; }
}

@media (max-width: 480px) {
  /* Keep 2-col grid — never drop to 1 col */
  .ecosystem__caps-grid { grid-template-columns: 1fr 1fr; }
  .outcomes-grid { grid-template-columns: repeat(2, 1fr); }
}
