.geography {
  background: var(--dark-surface);
  color: var(--white);
}

.geo-heading {
  display: grid;
  gap: 12px;
  margin-block-end: clamp(20px, 4vw, 42px);
}

.geo-heading p,
.geo-detail p {
  color: var(--dark-muted);
  font-size: .96rem;
  max-width: 46ch;
}

.geo-layout {
  display: grid;
  gap: 16px;
}

.geo-atlas {
  min-width: 0;
}

.geo-scene {
  position: relative;
  aspect-ratio: 720 / 448;
  overflow: hidden;
  isolation: isolate;
  background: #1b2c33;
}

.geo-plane {
  position: absolute;
  inset: 0;
}

.geo-relief {
  width: 100%;
  height: 100%;
}

.geo-boundaries {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.geo-boundaries path {
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.geo-regional-context {
  fill: none;
  stroke: color-mix(in srgb, var(--white) 28%, transparent);
  stroke-width: .55px;
}

.geo-area {
  fill: transparent;
  fill-rule: evenodd;
  stroke: color-mix(in srgb, var(--accent) 52%, var(--dark-surface));
  stroke-width: .85px;
}

.geo-ready .geo-area { pointer-events: fill; cursor: pointer; }
.geo-ready .geo-area:hover { stroke: var(--accent); }

.geography[data-region="spb"] [data-geo-area="spb"],
.geography[data-region="moscow"] [data-geo-area="moscow"],
.geography[data-region="northwest"] [data-geo-area="northwest"] {
  fill: color-mix(in srgb, var(--accent) 42%, transparent);
  stroke: var(--accent);
  stroke-width: 1.3px;
}

.geo-compass {
  position: absolute;
  top: 9%;
  right: 7%;
  color: var(--dark-muted);
  font-size: .7rem;
  text-align: center;
}

.geo-compass::after {
  content: '';
  display: block;
  margin: 3px auto 0;
  width: 12px;
  height: 17px;
  background: currentColor;
  clip-path: polygon(50% 0, 96% 98%, 50% 71%, 4% 98%);
}

.geo-pin {
  appearance: none;
  display: none;
  position: absolute;
  z-index: 1;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

.geo-ready .geo-pin { display: block; }

.geo-pin::before,
.geo-pin::after {
  content: '';
  position: absolute;
  top: var(--dot-y, 50%);
  left: var(--dot-x, 50%);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

.geo-pin::before {
  width: 10px;
  height: 10px;
  background: currentColor;
  border: 1px solid var(--dark-surface);
}

.geo-pin::after {
  width: 23px;
  height: 23px;
  border: 1px solid currentColor;
  opacity: 0;
}

.geo-pin[aria-pressed="true"] { z-index: 2; }
.geo-pin[aria-pressed="true"]::after,
.geo-pin:hover::after { opacity: .66; }
.geo-pin:focus-visible { outline-offset: -4px; }

.geo-pin-spb {
  left: calc(24.45% - 33px);
  top: calc(53.29% - 10px);
  --dot-x: 33px;
  --dot-y: 10px;
}

.geo-pin-moscow {
  left: calc(45.94% - 22px);
  top: calc(77.91% - 22px);
}

.geo-position,
.geo-region-name {
  position: absolute;
  z-index: 3;
  color: var(--white);
  font-size: clamp(.63rem, 2vw, .84rem);
  text-shadow: 0 0 6px #000, 0 2px 3px #000;
  white-space: nowrap;
}

.geo-position {
  transform: translate(11px, -50%);
  pointer-events: none;
}

.geo-position-spb {
  top: 53.29%;
  left: 24.45%;
}

.geo-region-name {
  top: 26.47%;
  left: 31.47%;
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  transform: translate(-50%, -50%);
  font-weight: 650;
  text-decoration: none;
}

.geo-position-moscow {
  top: 77.91%;
  left: 45.94%;
}

.geography[data-region="northwest"] .geo-region-name {
  font-weight: 730;
}

.geo-atlas figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 14px;
  padding: 9px 0 0;
  color: var(--dark-muted);
  font-size: .68rem;
}

.geo-atlas figcaption a {
  text-underline-offset: .18em;
}

.geo-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.geo-options a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px min(3vw, .9rem);
  border: 1px solid var(--dark-border);
  color: var(--white);
  font-size: .84rem;
  font-weight: 650;
  line-height: 1.15;
  text-decoration: none;
}

.geo-options a[aria-current] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
}

.geo-options a:hover,
.geo-options a:focus-visible {
  border-color: var(--accent);
}

.geo-details {
  display: grid;
  gap: 10px;
  margin-block-start: 13px;
}

.geo-detail {
  padding-block-start: 12px;
  border-top: 1px solid var(--dark-border);
}

.geo-detail h3 {
  margin-block-end: 7px;
  font-family: var(--display);
  font-size: clamp(.98rem, 2.4vw, 1.22rem);
  font-weight: 570;
  line-height: 1.35;
}

.geo-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--accent);
  font-size: .88rem;
  font-weight: 650;
  text-underline-offset: .23em;
}

@media (min-width: 850px) {
  .geo-heading {
    grid-template-columns: 1.34fr 1fr;
    align-items: end;
  }

  .geo-layout {
    grid-template-columns: minmax(0, 2fr) minmax(252px, 1fr);
    align-items: start;
    gap: clamp(20px, 4vw, 54px);
  }

  .geo-details { margin-top: 20px; }
}

@media (prefers-reduced-motion: no-preference) {
  .geo-area { transition: fill .2s ease, stroke .2s ease; }
  .geo-pin::before,
  .geo-pin::after,
  .geo-options a { transition: background-color .18s ease, border-color .18s ease, opacity .22s ease; }
}
