/* Every map dot is rendered by the existing terrain canvas. */
.terrain-city-auras {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.terrain-city-auras[hidden] { display: none; }
.terrain-city-aura {
  position: absolute;
  border-radius: 50%;
  background: rgba(125, 14, 232, .10);
  transform: translate(-50%, -50%);
  opacity: 0;
}
.opportunity-canvas { position: relative; z-index: 1; }
.terrain-city-lights {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.terrain-city-lights[hidden] { display: none; }

.terrain-city-connectors {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.terrain-city-connectors path {
  fill: none;
  stroke-width: .7px;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
}

.terrain-map-city-label {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
  color: #7d0ee8;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: var(--tracking, -.03em);
  transform: translateY(-50%);
}
.terrain-map-city-label[data-side="left"] { transform: translate(-100%, -50%); }
.terrain-map-city-label[hidden] { display: none; }
.terrain-map-copy { display: none; }
.home-content[data-scroll-motion] .terrain-map-copy {
  position: absolute;
  /* Vertically centred on the left, beside the map. */
  inset: 50% var(--content-inset) auto;
  display: block;
  z-index: 3;
  text-align: left;
  pointer-events: none;
  /* Centre heading + description (the description hangs ~96px below). */
  transform: translateY(calc(-50% - 48px + var(--opportunity-pan, 0px)));
  color: #191f28;
}
.home-content #services .terrain-map-copy h3 {
  margin: 0;
  font-size: var(--hero-font-size);
  line-height: 1.3;
  letter-spacing: var(--tracking, -.03em);
  font-weight: 600;
}
.terrain-map-copy__swap { display: inline-grid; }
.terrain-map-copy__swap > span {
  grid-area: 1 / 1;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility 0s .22s;
}
.terrain-map-copy__line { display: block; overflow: hidden; }
.terrain-map-copy__line > span {
  display: block;
  transform: translateY(112%);
  transition: transform 0s .22s;
}
.terrain-map-copy[data-copy="korea"] [data-country="korea"],
.terrain-map-copy[data-copy="indonesia"] [data-country="indonesia"] {
  opacity: 1;
  visibility: visible;
  transition: opacity .16s ease, visibility 0s;
}
.terrain-map-copy[data-copy="korea"] [data-country="korea"] .terrain-map-copy__line > span,
.terrain-map-copy[data-copy="indonesia"] [data-country="indonesia"] .terrain-map-copy__line > span {
  transform: translateY(0);
  transition: transform 1.1s cubic-bezier(.76, 0, .18, 1) .08s;
}
.terrain-map-copy[data-copy="korea"] [data-country="korea"] .terrain-map-copy__line:nth-child(2) > span,
.terrain-map-copy[data-copy="indonesia"] [data-country="indonesia"] .terrain-map-copy__line:nth-child(2) > span {
  transition-delay: .17s;
}
.terrain-map-copy[data-copy="korea"] [data-country="korea"] .terrain-map-copy__line:nth-child(3) > span {
  transition-delay: .26s;
}
.terrain-supplier-count {
  display: inline-grid;
  font-variant-numeric: tabular-nums;
}
.terrain-supplier-count::before {
  content: "45,000";
  grid-area: 1 / 1;
  visibility: hidden;
}
.terrain-supplier-count__value {
  grid-area: 1 / 1;
  text-align: right;
}
.home-content #services .terrain-map-copy p {
  position: absolute;
  top: calc(var(--hero-font-size) * 2.6 + 24px);
  left: 0;
  margin: 0;
  font-size: 18px;
  line-height: 1.6;
  color: #8b95a1;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease, visibility 0s .22s;
}
.home-content #services .terrain-map-copy[data-copy="korea"] p[data-country="korea"],
.home-content #services .terrain-map-copy[data-copy="indonesia"] p[data-country="indonesia"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .65s ease .6s, transform .65s ease .6s, visibility 0s;
}
.home-content #services .terrain-map-copy p[data-country="korea"] {
  top: calc(var(--hero-font-size) * 3.9 + 24px);
}
.home-content[data-scroll-motion] .opportunity-field {
  transform: translate(-50%, calc(var(--opportunity-pan, 0px) * var(--map-korea, 0)));
}
.home-content[data-scroll-motion] .opportunity-meta,
.home-content[data-scroll-motion] .terrain-regions,
.home-content[data-scroll-motion] #services-title { opacity: calc((1 - var(--map-depart, 0)) * (1 - var(--title-hide, 0))); }

@media (prefers-reduced-motion: reduce) {
  .terrain-map-copy__swap > span,
  .terrain-map-copy__line > span,
  .home-content #services .terrain-map-copy p { transition: none !important; }
}

/* On the charcoal surface the map copy and city marks are inverted. */
.home-content[data-scroll-motion] .terrain-map-copy { color: color-mix(in srgb, #191f28, #fff calc(100% * var(--map-invert, 0))); }
.home-content #services .terrain-map-copy p { color: color-mix(in srgb, #8b95a1, #c3c3c8 calc(100% * var(--map-invert, 0))); }
.terrain-map-city-label { color: color-mix(in srgb, #8015e8, #cfaeff calc(100% * var(--map-invert, 0))); }
/* Terrain labels belong to the finale only (the maps open the scene). */
.home-content[data-scroll-motion] :is(.terrain-regions, .opportunity-details, .opportunity-meta) { opacity: var(--final-terrain, 0); }
/* Indonesia spreads across the middle of the view: lift the copy above it. */
.home-content[data-scroll-motion] .terrain-map-copy {
  transition: transform .9s cubic-bezier(.22, 1, .36, 1);
}
.home-content[data-scroll-motion] .terrain-map-copy[data-copy="indonesia"] {
  transform: translateY(calc(-50% - 48px - 12vh + var(--opportunity-pan, 0px)));
}

/* Indonesia → finale: copy fades as the light surface rises. */
.home-content[data-scroll-motion] .terrain-map-copy { opacity: calc(1 - var(--wipe-fade, 0)); }

/* Finale rise: 23년간 content slides up from below while the Indonesia copy is pushed up. */
.home-content[data-scroll-motion] :is(#services-title, .opportunity-cta, .terrain-regions, .opportunity-details, .opportunity-meta) {
  translate: 0 calc((1 - var(--finale-rise, 1)) * 100svh);
}
.home-content[data-scroll-motion] .terrain-map-copy {
  translate: 0 calc(var(--finale-rise-up, 0) * -100svh);
}

/* 회사 소개 보기 sits in the meta row's middle slot, without a background. */
.opportunity-meta__cta-slot { display: block; height: 40px; }
.home-content[data-scroll-motion] .opportunity-cta { background: transparent; padding-left: 4px; }
.home-content[data-scroll-motion] .opportunity-cta:hover { background: transparent; color: #7938d6; }

/* City circles on the navy map: soft white instead of purple so they read. */
.terrain-city-aura {
  background: color-mix(in srgb, rgba(125, 14, 232, .10), rgba(236, 230, 255, .085) calc(100% * var(--map-invert, 0)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, transparent, rgba(255, 255, 255, .06) calc(100% * var(--map-invert, 0)));
}
.terrain-map-city-label { color: color-mix(in srgb, #8015e8, #e4dcff calc(100% * var(--map-invert, 0))); }

/* Labels must sit above the terrain canvas so hovering them selects a region. */
.terrain-regions { z-index: 2; }
