/* Area Coverage — peta Indonesia + titik kota (js/coverage.js)
   Saat dimuat semua titik berwarna biru dan berdenyut tipis. Saat kota dipilih: kamera memperbesar peta ke kota itu,
   titik terpilih berwarna biru tua dengan denyut kuat + label, titik lain meredup. */

/* nilai zoom kamera (dianimasikan bersama transform agar titik tetap berukuran konstan) */
@property --zoom { syntax: '<number>'; inherits: true; initial-value: 1; }

.coverage__head { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: end; margin-bottom: 20px; }
.coverage__head .lead { margin-top: 14px; }
.coverage__hq { width: 240px; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--glass-shadow); }
.coverage__hq img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

/* ---------- Peta (tanpa kontainer; tepi memudar halus saat di-zoom) ---------- */
.map {
  position: relative; width: 100%; aspect-ratio: 2.58; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent), linear-gradient(180deg, transparent, #000 5%, #000 95%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent), linear-gradient(180deg, transparent, #000 5%, #000 95%, transparent);
          mask-composite: intersect;
}
.map__stage { position: absolute; inset: 5% 4%; transform-origin: 0 0; --zoom: 1; }
.map__svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.map__svg path { fill: none; stroke: var(--map-line); stroke-width: calc(1.2px / var(--zoom));   /* garis tetap tipis saat di-zoom */ stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Titik kota ---------- */
.pin {
  position: absolute; left: var(--x); top: var(--y); z-index: 1;
  width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer;
  transform: translate(-50%, -50%) scale(calc(1 / var(--zoom)));   /* melawan zoom kamera → ukuran titik tetap */
  -webkit-tap-highlight-color: transparent; transition: opacity .45s;
}
.pin::before { /* inti titik */
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: var(--pin); box-shadow: 0 0 0 2px rgba(255, 255, 255, .6), 0 0 12px var(--pin);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), background .3s, box-shadow .3s;
}
.pin::after { /* denyut tipis (idle) */
  content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; border: 1.5px solid var(--pin); opacity: 0;
  animation: pin-idle 3.2s ease-out infinite; animation-delay: var(--d, 0s);
}
.pin__wave { /* gelombang kedua — hanya saat terpilih */
  position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; border: 2px solid var(--pin-active); opacity: 0; pointer-events: none;
}
.pin__label {
  position: absolute; left: 50%; bottom: calc(100% - 2px); transform: translate(-50%, 6px);
  padding: 5px 13px; border-radius: 99px; white-space: nowrap; pointer-events: none;
  font: 600 12.5px var(--font-display); color: #fff; background: var(--pin);
  box-shadow: 0 10px 24px -10px rgba(0, 10, 50, .6); opacity: 0; transition: opacity .25s, transform .25s;
}
.pin:hover .pin__label, .pin:focus-visible .pin__label { opacity: 1; transform: translate(-50%, 0); }
.pin:hover { z-index: 2; }

/* kota terpilih */
.pin.is-active { z-index: 3; }
.pin.is-active::before { background: var(--pin-active); transform: scale(1.5); box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 20px var(--pin-active); }
.pin.is-active::after { border-color: var(--pin-active); border-width: 2px; opacity: 0; animation: pin-active 1.5s ease-out infinite; animation-delay: 0s; }
.pin.is-active .pin__wave { animation: pin-active 1.5s ease-out infinite; animation-delay: .75s; }
.pin.is-active .pin__label { opacity: 1; transform: translate(-50%, 0); background: var(--pin-active); }
.map.has-active .pin:not(.is-active) { opacity: .3; }

@keyframes pin-idle   { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(3.2); opacity: 0; } }
@keyframes pin-active { 0% { transform: scale(1); opacity: .95; } 100% { transform: scale(7); opacity: 0; } }

/* ---------- Chip kota ---------- */
.map-hint { text-align: center; margin-top: 4px; font: 500 12.5px var(--font-display); color: var(--muted); }
.offices { margin-top: 18px; }
.offices li { padding: 0; border: 0; background: none; backdrop-filter: none; }
.offices li:hover { background: none; }
.office {
  padding: 12px 24px; border-radius: 99px; font: 500 15px var(--font-display); cursor: pointer;
  border: 1px solid var(--line); background: var(--glass-fill); color: var(--text);
  display: inline-flex; align-items: center; gap: 10px;
  transition: background .25s, border-color .25s, color .25s, transform .25s, box-shadow .25s;
}
.office::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pin); flex: none; transition: background .25s; }
.office:hover { border-color: var(--pin); transform: translateY(-2px); }
.office.is-hq { font-weight: 700; border: 1.5px solid var(--pin-active); }
.office.is-active { background: var(--pin-active); color: #fff; border-color: transparent; transform: translateY(-2px); box-shadow: 0 12px 26px -10px var(--pin-active); }
.office.is-active::before { background: #fff; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .coverage__head { grid-template-columns: 1fr; }
  .coverage__hq { display: none; }
  .map { aspect-ratio: 2.1; }
  .map__stage { inset: 13.3% 4%; }   /* rasio panggung tetap sama dengan peta, kanvas sedikit lebih tinggi */
  .pin { width: 34px; height: 34px; }
  .pin::before, .pin::after, .pin__wave { width: 8px; height: 8px; margin: -4px 0 0 -4px; }
  .pin__label { font-size: 12px; padding: 4px 11px; }
  .offices { gap: 8px; }
  .office { padding: 10px 16px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .pin::after { animation: none; opacity: .35; transform: scale(2); }
  .pin.is-active::after, .pin.is-active .pin__wave { animation: none; opacity: .6; transform: scale(3.2); }
  .pin__label, .pin::before { transition: none; }
}
