/* ==========================================================================
   NOMADO — Секция «Мир Nomado» (география)
   Тёмная иммерсивная секция. Точечная карта мира + интерактивные маркеры
   регионов, соединительные дуги от Казахстана, панель с описанием.
   ========================================================================== */

.geo {
  position: relative;
  padding-block: var(--nm-section-gap);
  background: #0b0704;
  color: #fff;
  overflow: hidden;
  border-radius: var(--nm-radius-lg);
}
/* тёплое бордовое свечение сверху */
.geo::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 72% 0%, rgba(242,53,0,.20) 0%, rgba(80,20,0,.10) 34%, transparent 68%);
}
.geo__inner { position: relative; z-index: 1;
  width: 100%; max-width: var(--nm-content); margin-inline: auto; padding-inline: clamp(20px, 4vw, 60px); }

/* ------------------------------------------------------------- шапка */
.geo__head { max-width: 90ch; margin-bottom: clamp(34px, 4.5vw, 60px); }
.geo__eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-size: clamp(.72rem, .95vw, .85rem); font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--nm-orange);
  margin: 0 0 clamp(14px, 1.6vw, 20px);
}
.geo__eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--nm-orange); border-radius: 2px; }
.geo__title {
  margin: 0 0 clamp(16px, 1.8vw, 24px); font-weight: 800; letter-spacing: -.02em;
  line-height: .96; text-transform: uppercase; font-size: clamp(2.2rem, 5.2vw, 4.4rem);
}
.geo__title em { font-style: normal; color: var(--nm-orange); }
.geo__lead { margin: 0; max-width: 88ch; color: rgba(255,255,255,.72);
  font-size: clamp(1rem, 1.25vw, 1.16rem); line-height: 1.7; }

/* ------------------------------------------------------------- сцена */
.geo__stage {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 2.4vw, 40px); align-items: stretch;
}

/* ------- глобус ------- */
.geo__map {
  position: relative; aspect-ratio: 1 / 1; width: 100%;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.10); border-radius: var(--nm-radius-md);
  background:
    radial-gradient(120% 120% at 50% 35%, rgba(255,90,30,.10), transparent 68%),
    #0d0805;
  overflow: hidden;
}
.geo__globe { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.geo__globe:active { cursor: grabbing; }
/* все слои делят один и тот же бокс 2:1 → координаты совпадают, без искажений */
.geo__map-dots, .geo__links, .geo__markers { position: absolute; inset: 0; }
.geo__map-dots {
  background: url('../bg/world-map-dots.webp') center / 100% 100% no-repeat;
  opacity: .4;
}
/* соединительные дуги: viewBox 100×50 (2:1) → равномерный масштаб, без искажений */
.geo__links { color: var(--nm-orange); overflow: visible; }
.geo__links path {
  fill: none; stroke: currentColor; stroke-width: .3; opacity: .32;
  stroke-linecap: round; stroke-dasharray: 200; stroke-dashoffset: 200;
}
.js .geo.io-in .geo__links path { animation: geo-draw 1.6s ease forwards; }
.geo__links path:nth-child(2) { animation-delay: .12s; }
.geo__links path:nth-child(3) { animation-delay: .24s; }
.geo__links path:nth-child(4) { animation-delay: .36s; }
.geo__links path:nth-child(5) { animation-delay: .48s; }
.geo__links path:nth-child(6) { animation-delay: .60s; }
@keyframes geo-draw { to { stroke-dashoffset: 0; } }

/* маркеры */
.geo__markers { z-index: 3; pointer-events: none; }
/* пин = точка 13px, её центр строго на (--x,--y); подпись позиционируется абсолютно */
.geo__pin {
  position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%);
  transform: translate(-50%, -50%);
  width: 13px; height: 13px; padding: 0; border: 0; background: none;
  cursor: pointer; pointer-events: auto; color: #fff; font-family: inherit;
}
.geo__pin-dot {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--nm-orange); box-shadow: 0 0 0 4px rgba(242,53,0,.20);
  transition: transform .25s ease, box-shadow .25s ease;
}
.geo__pin-dot::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--nm-orange); opacity: .6;
  animation: geo-pulse 2.4s ease-out infinite;
}
@keyframes geo-pulse { 0% { transform: scale(.6); opacity: .7 } 100% { transform: scale(2.3); opacity: 0 } }
/* подпись — по умолчанию справа от точки */
.geo__pin-label {
  position: absolute; left: calc(100% + 9px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-size: clamp(.6rem, .78vw, .74rem); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: .3em .62em; border-radius: var(--nm-radius-xs);
  background: rgba(10,6,3,.72); border: 1px solid rgba(255,255,255,.10);
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.geo__pin--l .geo__pin-label { left: auto; right: calc(100% + 9px); }
.geo__pin--t .geo__pin-label { left: 50%; right: auto; top: auto; bottom: calc(100% + 9px); transform: translateX(-50%); }
.geo__pin--b .geo__pin-label { left: 50%; right: auto; top: calc(100% + 9px); transform: translateX(-50%); }
.geo__pin:hover { z-index: 5; }
.geo__pin:hover .geo__pin-dot { transform: scale(1.28); }
.geo__pin:hover .geo__pin-label { border-color: var(--nm-border-glow); }
/* активный пин */
.geo__pin.is-active { z-index: 6; }
.geo__pin.is-active .geo__pin-dot {
  background: #fff; box-shadow: 0 0 0 5px rgba(255,47,0,.5), 0 0 22px rgba(255,47,0,.7); transform: scale(1.12);
}
.geo__pin.is-active .geo__pin-label {
  background: var(--nm-orange); border-color: transparent; color: #fff;
}

/* ------- панель ------- */
.geo__panel {
  display: flex; flex-direction: column;
  padding: clamp(24px, 2.4vw, 40px);
  border: 1px solid rgba(255,255,255,.12); border-radius: var(--nm-radius-md);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
}
.geo__panel-top { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(14px, 1.6vw, 22px); }
.geo__panel-idx {
  font-weight: 800; font-variant-numeric: tabular-nums; color: var(--nm-orange);
  font-size: clamp(1rem, 1.3vw, 1.2rem); letter-spacing: .06em;
}
.geo__panel-line { flex: 1; height: 1px; background: rgba(255,255,255,.14); }
.geo__panel-name {
  margin: 0 0 clamp(12px, 1.4vw, 18px); font-weight: 800; letter-spacing: -.01em;
  text-transform: uppercase; line-height: 1; font-size: clamp(1.8rem, 3.2vw, 2.8rem);
}
.geo__panel-text {
  margin: 0; color: rgba(255,255,255,.74); line-height: 1.66;
  font-size: clamp(.98rem, 1.15vw, 1.1rem); min-height: 5.4em;
}
/* мягкая смена текста */
.geo__panel-name, .geo__panel-text { transition: opacity .3s ease; }
.geo__panel.is-swapping .geo__panel-name,
.geo__panel.is-swapping .geo__panel-text { opacity: 0; }

/* вкладки-регионы — вертикальный нумерованный список */
.geo__tabs { list-style: none; margin: auto 0 0; padding: clamp(16px,2vw,24px) 0 0;
  display: flex; flex-direction: column; counter-reset: reg; }
.geo__tab {
  position: relative; width: 100%; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; gap: 16px; text-align: left;
  padding: clamp(11px,1.1vw,15px) 12px;
  background: none; border: 0; border-top: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.62);
  transition: color .24s ease, padding-left .24s ease, background .24s ease;
}
.geo__tabs li:last-child .geo__tab { border-bottom: 1px solid rgba(255,255,255,.10); }
/* индекс 01–07 */
.geo__tab::before {
  counter-increment: reg; content: counter(reg, decimal-leading-zero);
  font-size: .74rem; font-weight: 700; letter-spacing: .1em;
  font-variant-numeric: tabular-nums; color: rgba(255,255,255,.34);
  transition: color .24s ease;
}
.geo__tab-name { flex: 1; font-weight: 600; letter-spacing: .01em;
  font-size: clamp(.95rem, 1.15vw, 1.12rem); }
/* стрелка */
.geo__tab::after {
  content: "→"; color: var(--nm-orange); font-weight: 700;
  opacity: 0; transform: translateX(-8px);
  transition: opacity .24s ease, transform .24s ease;
}
.geo__tab:hover { color: #fff; padding-left: 18px; background: rgba(255,255,255,.03); }
.geo__tab:hover::before { color: var(--nm-orange); }
.geo__tab:hover::after { opacity: .7; transform: none; }
/* активный */
.geo__tab.is-active {
  color: #fff; padding-left: 20px;
  box-shadow: inset 3px 0 0 var(--nm-orange);
  background: linear-gradient(90deg, rgba(242,53,0,.14), transparent 70%);
}
.geo__tab.is-active::before { color: var(--nm-orange); }
.geo__tab.is-active .geo__tab-name { font-weight: 800; }
.geo__tab.is-active::after { opacity: 1; transform: none; }

/* ------- финал ------- */
.geo__outro {
  margin: clamp(30px, 3.4vw, 52px) auto 0; max-width: 72ch; text-align: center;
  color: rgba(255,255,255,.66); font-size: clamp(1rem, 1.25vw, 1.18rem); line-height: 1.6;
}
.geo__outro b { color: #fff; font-weight: 700; }

/* ------- появление ------- */
.js .geo [data-io] { opacity: 0; transform: translateY(28px); }
.js .geo [data-io].io-in { opacity: 1; transform: none;
  transition: opacity .7s ease, transform .8s cubic-bezier(.19,.9,.22,1); }

/* --------------------------------------------------------------- адаптив */
@media (max-width: 1000px) {
  .geo__stage { grid-template-columns: 1fr; }
  .geo__panel-text { min-height: 0; }
}
@media (max-width: 640px) {
  /* убираем блок-обёртку панели — содержание на всю ширину секции */
  .geo__panel {
    padding: 0; border: 0; border-radius: 0; background: none;
  }
  .geo__tabs { padding-top: clamp(18px, 4vw, 24px); }
}
@media (max-width: 560px) {
  .geo__pin-label { display: none; }
  .geo__map { aspect-ratio: 3 / 2; }
}
@media (prefers-reduced-motion: reduce) {
  .geo__pin-dot::after,
  .js .geo.io-in .geo__links path { animation: none; }
  .geo__links path { stroke-dashoffset: 0; }
}
