/* Wave 2 globe rework. This file refines the pin, label, halo and atmosphere
   treatments. The dark gradient background for .globe-section already lives in
   sections.css (untouched in Wave 2); we layer extra rules and a fallback
   selector here for safety. */

/* Section dark wrapper fallback. .globe-section in sections.css is the primary
   selector but we add data-section / id selectors so the dark inversion still
   reads if markup shifts. Use linear-gradient between --night and --night-2. */
[data-section="globe"],
#globe.section,
.section--globe {
  background: linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
  color: rgba(255, 255, 255, 0.92);
}

[data-section="globe"] h2,
[data-section="globe"] h3,
#globe h2,
#globe h3 { color: #fff; }

[data-section="globe"] .eyebrow,
#globe .eyebrow { color: rgba(255, 255, 255, 0.62); }

/* Country line under the city name in the side panel. Light-on-dark since the
   globe section runs against the navy gradient. */
.globe-info-country {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.72);
  margin: 4px 0 0;
  letter-spacing: 0.01em;
}

/* Globe SVG basics */
#globe-viz { display: block; width: 100%; }

#globe-viz .sphere {
  fill: url(#globe-atmosphere);
  stroke: var(--night-line);
  stroke-width: 1;
}

#globe-viz .graticule {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 0.5;
}

#globe-viz .land {
  fill: rgba(220, 230, 245, 0.12);
  stroke: rgba(255, 255, 255, 0.10);
  stroke-width: 0.5;
}

/* Pins. Smooth metric tweens via CSS while D3 still drives positions. */
#globe-viz .pin {
  transition:
    r var(--dur-base, 320ms) var(--ease-responsive),
    fill var(--dur-base, 320ms) var(--ease-responsive),
    opacity var(--dur-base, 320ms) var(--ease-responsive);
  cursor: pointer;
}

#globe-viz .pin.is-back { pointer-events: none; }

#globe-viz .pin.is-selected {
  stroke: #fff;
  stroke-width: 2;
}

/* Invisible larger hit target. Hidden on back hemisphere via class. */
#globe-viz .pin-hit {
  fill: transparent;
  pointer-events: all;
  cursor: pointer;
}

#globe-viz .pin-hit.is-back { pointer-events: none; }

/* Pin halo, a separate circle that sits behind the selected pin. */
#globe-viz .pin-halo {
  fill: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

#globe-viz .pin-halo.is-active {
  animation: pin-pulse 1800ms var(--ease-stately, ease) 1 forwards;
}

@keyframes pin-pulse {
  0%   { opacity: 0;   transform: scale(0.6); }
  35%  { opacity: 0.6; transform: scale(1.0); }
  100% { opacity: 0;   transform: scale(1.4); }
}

/* Hover label. DM Sans 600, white fill, dark stroke for contrast across
   ocean and land. */
#globe-viz .pin-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  fill: #fff;
  paint-order: stroke fill;
  stroke: rgba(10, 20, 38, 0.92);
  stroke-width: 6;
  stroke-linejoin: round;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

@media (prefers-reduced-motion: reduce) {
  #globe-viz .pin {
    transition: none;
  }
  #globe-viz .pin-halo.is-active {
    animation: none;
    opacity: 0;
  }
}

/* Globe info panel: scaled metric strip on the dark background. */
#globe-panel .globe-panel-strip-caption,
.globe-panel .globe-panel-strip-caption {
  font-family: var(--font-body);
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.55);
  margin: 18px 0 6px;
  letter-spacing: 0.01em;
}

#globe-panel .metric-strip,
.globe-panel .metric-strip {
  grid-template-columns: repeat(6, 24px);
  gap: 8px;
}
#globe-panel .metric-strip .ms-cell,
.globe-panel .metric-strip .ms-cell { gap: 5px; }
#globe-panel .metric-strip .ms-bar-wrap,
.globe-panel .metric-strip .ms-bar-wrap { height: 30px; }
#globe-panel .metric-strip .ms-bar,
.globe-panel .metric-strip .ms-bar {
  width: 11px;
  max-height: 30px;
  background: rgba(255, 255, 255, 0.20);
  border-radius: 1px;
}
#globe-panel .metric-strip .ms-cell[data-tier="quiet"] .ms-bar,
.globe-panel .metric-strip .ms-cell[data-tier="quiet"] .ms-bar { background: rgba(255, 255, 255, 0.85); }
#globe-panel .metric-strip .ms-cell[data-tier="loud"] .ms-bar,
.globe-panel .metric-strip .ms-cell[data-tier="loud"] .ms-bar { background: var(--scale-5); }
#globe-panel .metric-strip .ms-cell[data-tier="mid"] .ms-bar,
.globe-panel .metric-strip .ms-cell[data-tier="mid"] .ms-bar { background: rgba(255, 255, 255, 0.45); }
#globe-panel .metric-strip .ms-icon,
.globe-panel .metric-strip .ms-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: rgba(255, 255, 255, 0.92);
  opacity: 1;
}
#globe-panel .metric-strip .ms-icon svg,
.globe-panel .metric-strip .ms-icon svg { width: 18px; height: 18px; display: block; }
#globe-panel .metric-strip .ms-cell[data-tier="quiet"] .ms-icon,
.globe-panel .metric-strip .ms-cell[data-tier="quiet"] .ms-icon { color: #ffffff; }
#globe-panel .metric-strip .ms-cell[data-tier="loud"] .ms-icon,
.globe-panel .metric-strip .ms-cell[data-tier="loud"] .ms-icon { color: var(--scale-5); }

/* Globe metric switcher pill contrast: the dark navy section needs an
   explicit white-on-navy active state. Inactive pills sit in a low-contrast
   ghost so the active one always reads. */
[data-section="globe"] #globe-metrics .pill,
.globe-section #globe-metrics .pill,
#globe #globe-metrics .pill {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
[data-section="globe"] #globe-metrics .pill:hover,
.globe-section #globe-metrics .pill:hover,
#globe #globe-metrics .pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
[data-section="globe"] #globe-metrics .pill.is-active,
[data-section="globe"] #globe-metrics .pill[aria-pressed="true"],
.globe-section #globe-metrics .pill.is-active,
.globe-section #globe-metrics .pill[aria-pressed="true"],
#globe #globe-metrics .pill.is-active,
#globe #globe-metrics .pill[aria-pressed="true"] {
  background: #ffffff;
  color: var(--brand-navy);
  border-color: #ffffff;
}
