/* ═══════════════════════════════════════════════════════════════
   AWWWARDS UPGRADES — v2.0
   Purple (#8B5CF6) + Emerald (#10B981) interactive enhancements
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. HERO STATS — counter glow + flag tooltips ─────────── */
.stat-num {
  font-feature-settings: 'tnum' 1;
}
.stat-num .counter {
  display: inline-block;
  min-width: 1.2ch;
}
.flag-item {
  cursor: pointer;
  transition: transform 0.2s ease;
  position: relative;
  user-select: none;
}
.flag-item:hover {
  transform: scale(1.3);
}

/* ── 2. SERVICES — neon pill tabs + accordion panels ──────── */
.svc-pills-wrap {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.svc-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.8rem;
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted, #a1a1aa);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: visible;
}
.svc-pill:hover {
  border-color: rgba(16, 185, 129, 0.6);
  color: #10B981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}
.svc-pill.active {
  border-color: #10B981;
  color: #ffffff;
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.2), inset 0 0 12px rgba(16, 185, 129, 0.05);
}
.svc-pill-num {
  font-size: 0.72rem;
  opacity: 0.5;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.svc-panels {
  position: relative;
}
.svc-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.svc-panel.active {
  max-height: 600px;
}
.svc-panel-inner {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
}
/* Two-column grid: text left, canvas right */
.svc-panel-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: center;
}
.svc-panel-text {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.svc-panel-canvas-wrap {
  height: 300px;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(139, 92, 246, 0.03);
  border: 1px solid rgba(139, 92, 246, 0.08);
}
.svc-panel-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.svc-panel-title {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 700;
  margin: 0;
}
.svc-panel-hook {
  display: block;
  color: #10B981;
  font-size: 0.95rem;
}
.svc-panel-desc {
  color: var(--text-muted, #a1a1aa);
  max-width: 60ch;
  line-height: 1.7;
}

/* ── 3. PROCESS — horizontal pill timeline ────────────────── */
.timeline-overflow {
  overflow: hidden;
  width: 100%;
  padding: 2rem 0 3rem;
}
.timeline-track {
  display: flex;
  gap: 1.5rem;
  padding: 0 2rem;
  will-change: transform;
}
.timeline-card {
  flex-shrink: 0;
  min-width: 300px;
  max-width: 360px;
  padding: 2rem 1.8rem;
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.timeline-card.active {
  transform: scale(1.05);
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.04);
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.12), 0 8px 32px rgba(0, 0, 0, 0.3);
}
.timeline-num {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #8B5CF6 0%, #10B981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.8rem;
  opacity: 0.4;
}
.timeline-card.active .timeline-num {
  opacity: 1;
}
.timeline-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.timeline-card em {
  display: block;
  color: #10B981;
  font-size: 0.88rem;
  margin-bottom: 0.8rem;
}
.timeline-card p {
  color: var(--text-muted, #a1a1aa);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* ── 4. CLIENTS — map canvas & tooltips ─────────────────────── */
#clients-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.7;      /* increased for star-like visibility */
  pointer-events: auto; /* allow mouse events for tooltips */
}
.trusted-section {
  position: relative;
  overflow: hidden;
  padding: 8rem 0 6rem; /* increased padding */
  min-height: 850px;    /* massively increased to prevent tooltip clipping */
}
.trusted-section .section-head,
.trusted-section .trusted-stats {
  position: relative;
  z-index: 1;
  pointer-events: none; /* let clicks pass to map */
}
/* New enlarged hero-like stats for clients section */
.trusted-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.trusted-stats .stat-item {
  text-align: center;
}
.trusted-stats .stat-num {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #8B5CF6 0%, #10B981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.trusted-stats .stat-label {
  color: var(--text-muted, #a1a1aa);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Explore Map Indicator Centering */
.explore-map-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 3rem auto 0;
  width: 100%;
}

/* Map Interactive Tooltip */
#map-tooltip {
  position: absolute;
  z-index: 20;
  background: rgba(15, 23, 42, 0.85); /* Slate 900 */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  padding: 1rem;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -100%) translateY(-15px);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.1);
  min-width: 140px;
  max-width: 250px;
  text-align: center;
}
#map-tooltip.active {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(-25px);
}
#map-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(15, 23, 42, 0.85);
  border-right: 1px solid rgba(139, 92, 246, 0.3);
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}
#map-tooltip-location {
  display: block;
  font-size: 0.75rem;
  color: #10B981;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  font-weight: 700;
}
#map-tooltip-logos {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}
#map-tooltip-logos img {
  max-height: 50px;
  max-width: 180px;
  object-fit: contain;
  background: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

/* ── 5. RECENT WORK — magnetic grid 3D ────────────────────── */
.proj-card {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
/* Neutralise the old CSS hover so magnetic-grid.js owns all transforms */
.proj-card:hover {
  transform: none !important;
}
/* The ::after glow on hover stays — it's opacity-only, no conflict */

/* ── 6. CTA — reactor canvas ──────────────────────────────── */
#cta-reactor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#contact {
  position: relative;
  overflow: hidden;
}
#contact .cta-glow {
  position: relative;
  z-index: 0;
}
#contact .container {
  position: relative;
  z-index: 1;
}

/* ── Mobile: disable heavy canvas + adjust layouts ─────────── */
@media (max-width: 767px) {
  .svc-panel-canvas-wrap {
    display: block;
    height: 200px;
    margin-top: 1rem;
  }
  .svc-panel-grid {
    grid-template-columns: 1fr;
  }
  .timeline-card {
    min-width: 260px;
    max-width: 300px;
  }
  .svc-pills-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .svc-pill {
    justify-content: center;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .svc-panel-grid {
    grid-template-columns: 1fr 260px;
  }
  .svc-panel-canvas-wrap {
    height: 240px;
  }
}
