/* =========================================================
   SERVICES — Firefly Balls Interaction
   Signature orange: #D96535
   ========================================================= */

/* ── Services toggle button ── */
#services-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 28px;
  margin-top: 28px;
  background: #D96535;
  border: none;
  border-radius: 999px;
  color: #fff;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(217,101,53,0.38);
  transition:
    background 0.20s ease,
    box-shadow 0.20s ease;
  position: relative;
  z-index: 20;
  will-change: transform;
}

#services-btn:hover {
  background: #c9664a;
  box-shadow: 0 8px 28px rgba(217,101,53,0.50);
}

#services-btn[aria-expanded="true"] {
  background: rgba(217,101,53,0.14);
  color: #D96535;
  box-shadow: inset 0 0 0 1.5px #D96535;
}

#services-btn:focus-visible {
  outline: 2px solid #D96535;
  outline-offset: 4px;
}

/* ── Divider — removed ── */
#svc-divider { display: none !important; }

/* ── Balls container ── */
#svc-balls-wrap {
  display: none;  /* JS sets to flex when open */
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

/* ── Individual service ball — matches Work section .layer ── */
.svc-ball {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  overflow: hidden;

  cursor: pointer;
  padding: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;

  opacity: 0;
  will-change: transform, opacity;
  transition:
    background 220ms ease,
    box-shadow 220ms ease;
}

/* Flicker overlay — identical to work-card.css ::after */
.svc-ball::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;

  background: rgba(255,255,255,0.95);
  opacity: var(--ff-flicker-max-opacity, 0.98);
  transform: scale(1);
  transform-origin: center;
  filter:
    brightness(var(--ff-flicker-max-brightness, 1.12))
    contrast(var(--ff-flicker-max-contrast, 1.06));

  animation: ff-flicker var(--ff-flicker-speed, 3.4s) ease-in-out infinite;
}

/* Hover: stop flicker — visual handled by canonical rule in toolbar.css */
.svc-ball:hover {
  z-index: 10;
  position: relative;
}

.svc-ball:hover::after {
  animation: none;
  opacity: 0;
}

/* Active ball (selected service) */
.svc-ball.is-active {
  box-shadow: 0 0 0 2px #D96535, 0 6px 20px rgba(217,101,53,0.28);
  z-index: 10;
  position: relative;
}

.svc-ball.is-active::after {
  animation: none;
  opacity: 0;
}

.svc-ball:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(217,101,53,0.55), 0 0 0 6px rgba(217,101,53,0.18);
}

/* ── Ball label ── */
.svc-ball-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;

  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.3;
  color: rgba(28,25,23,0.88);
  word-break: break-word;

  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  z-index: 2;
}

.svc-ball:hover .svc-ball-label,
.svc-ball.is-active .svc-ball-label {
  opacity: 1;
}

@media (pointer: coarse) {
  .svc-ball-label { opacity: 0.80; }
}

/* ── Description panel ── */
#svc-desc {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 40px));
  z-index: 45;
  pointer-events: none;
  opacity: 0;
  will-change: opacity, transform;
}

#svc-desc[aria-hidden="false"] {
  pointer-events: auto;
}

#svc-desc-inner {
  background: rgba(250,248,244,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(28,25,23,0.09);
  border-radius: 18px;
  padding: 22px 26px 20px;
  box-shadow:
    0 16px 48px rgba(28,25,23,0.12),
    0 2px 8px rgba(28,25,23,0.06);
  text-align: center;
}

#svc-desc-text {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.72;
  color: rgba(28,25,23,0.78);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.svc-view-work-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #D96535;
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  transition: transform 0.18s ease, color 0.18s ease;
}

.svc-view-work-link:hover {
  color: #c9664a;
  transform: translateX(3px);
}

/* ── Mobile ── */
@media (max-width: 736px) {
  #svc-balls-wrap {
    gap: 10px;
    margin-top: 14px;
  }

  .svc-ball {
    width: 74px;
    height: 74px;
  }

  .svc-ball-label {
    font-size: 7px;
    padding: 9px;
    word-break: break-word;
  }

  #svc-desc {
    bottom: 108px;
    width: min(480px, calc(100vw - 24px));
  }

  #svc-desc-inner {
    padding: 18px 18px 16px;
  }

  #svc-desc-text {
    font-size: 12px;
    line-height: 1.65;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .svc-ball::after {
    animation: none;
    opacity: 1;
  }
}
