/* ------------------------------------------------------------------
   Global sourcing — dotted map with supply routes converging on Iran.

   The dots are a static SVG (scripts/build-world-map.mjs). Places are
   HTML positioned in % of the map, so labels use the site font and stay
   crisp; sourcing-map.js draws the routes between them.
------------------------------------------------------------------ */
.sourcing {
  --route: var(--color-gold);
  overflow: clip;
}

/* Slides up over the pinned products: the products track ends with one
   extra screen, and this section overlaps it by exactly that much. */
.js .sourcing {
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  margin-top: -100vh;
  border-top: 1px solid var(--color-line);
  border-radius: clamp(20px, 3vw, 36px) clamp(20px, 3vw, 36px) 0 0;
  background: var(--color-bg);
  box-shadow: 0 -40px 90px rgb(0 0 0 / 0.65);
}
@supports (height: 100svh) {
  .js .sourcing { margin-top: -100svh; }
}

.sourcing__head {
  display: grid;
  justify-items: center;
  gap: 18px;
  max-width: 40rem;
  margin: 0 auto clamp(40px, 6vw, 72px);
  text-align: center;
}
.sourcing__head .eyebrow[dir="ltr"] {
  text-align: center;
  margin-right: 0;
}
.sourcing__head .section__title { text-wrap: balance; }
.sourcing__lead {
  max-width: 34rem;
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 2;
  text-wrap: pretty;
  color: rgb(238 241 245 / 0.66);
}

/* ---------- Map ------------------------------------------------------ */
.sourcing__map {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  aspect-ratio: 180.5 / 98.86;
  user-select: none;
}

.sourcing__dots,
.sourcing__routes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.sourcing__dots {
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to bottom, transparent, #000 12%, #000 82%, transparent),
    linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent, #000 12%, #000 82%, transparent),
    linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-composite: intersect;
}

.sourcing__routes { overflow: visible; }
.sourcing__track,
.sourcing__route {
  fill: none;
  stroke-linecap: round;
}
.sourcing__track {
  stroke: var(--route);
  stroke-opacity: 0.22;
}
.sourcing__route { stroke: var(--color-gold-soft); }
.sourcing__spark { fill: #fff3dc; }

/* ---------- Places --------------------------------------------------- */
.sourcing__places {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sourcing__place {
  --size: 7px;
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: var(--size);
  height: var(--size);
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--route);
  box-shadow: 0 0 0 3px rgb(210 172 104 / 0.18), 0 0 14px rgb(210 172 104 / 0.7);
}
.sourcing__place::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--route);
  animation: sourcing-ping 2.4s var(--ease-out) infinite;
  animation-delay: var(--delay, 0s);
}
.sourcing__label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  translate: -50% 0;
  padding: 5px 11px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: rgb(0 3 11 / 0.86);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--color-text);
}
.sourcing__place[data-label="bottom"] .sourcing__label {
  top: calc(100% + 10px);
  bottom: auto;
}

/* Iran: the destination every route converges on. */
.sourcing__place--hub {
  --size: 11px;
  z-index: 1;
  background: var(--color-gold-soft);
  box-shadow: 0 0 0 4px rgb(210 172 104 / 0.22), 0 0 24px rgb(228 201 153 / 0.9);
}
.sourcing__place--hub .sourcing__label {
  border-color: rgb(210 172 104 / 0.45);
  font-size: 13px;
  color: var(--color-gold-soft);
}

@keyframes sourcing-ping {
  from { scale: 1; opacity: 0.6; }
  to   { scale: 4; opacity: 0; }
}

@media (max-width: 640px) {
  .sourcing__map { margin-inline: calc(var(--gutter) * -0.6); }
  .sourcing__place { --size: 5px; }
  .sourcing__place--hub { --size: 8px; }
  .sourcing__label {
    padding: 3px 8px;
    font-size: 10px;
  }
  .sourcing__place--hub .sourcing__label { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .sourcing__place::before { animation: none; opacity: 0; }
}
