/* 홈 전용 스타일 (PR ②: 메인 · 동네 3유형 · 4단계 · 계산기) */

/* ── 메인(Hero) ── */
.hero {
  padding-block: 72px 88px;
  background: radial-gradient(70% 60% at 78% 40%, rgba(67, 56, 202, 0.28), transparent 70%);
}

.hero__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-7);
  align-items: center;
}

.hero__copy {
  flex: 1 1 460px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: 6px;
}

.hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 18px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid rgba(140, 165, 230, 0.16);
}

.hero__facts div {
  display: flex;
  flex-direction: column;
}

.hero__facts dt {
  order: 2;
  font-size: 13px;
  color: var(--muted);
}

.hero__facts dd {
  order: 1;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
}

/* 지도 상자 */
.map {
  position: relative;
  flex: 1 1 520px;
  min-width: 0;
  max-width: 640px;
  aspect-ratio: 640 / 560;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b1224;
  margin: 0;
}

.map canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.map__tag {
  position: absolute;
  color: #ffffff;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
}

.map__tag small {
  display: block;
  font-weight: 500;
  font-size: 12px;
}

.map__tag--high {
  left: 4.4%;
  top: 6%;
  background: var(--indigo);
}

.map__tag--far {
  left: 5.6%;
  bottom: 12.5%;
  background: var(--map-far);
}

/* 베트남어: 범례가 두 줄(+25px)이라 아래 태그를 그만큼 올린다 (11차, ko·en은 그대로) */
.map__tag--far:lang(vi) {
  bottom: calc(12.5% + 25px);
}

.map__card {
  position: absolute;
  right: 3.4%;
  top: 20%;
  min-width: 214px; /* 영어처럼 긴 라벨은 카드가 넓어짐 (한국어는 214px 그대로) */
  background: rgba(13, 20, 38, 0.94);
  border: 1px solid rgba(251, 146, 60, 0.55);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.map__card .badge {
  align-self: flex-start;
  letter-spacing: 0.06em;
}

.map__card-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
}

.map__card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.map__card dt,
.map__card dd {
  white-space: nowrap;
}

.map__card dd {
  margin: 0;
  color: var(--text);
  text-align: right;
}

.map__card dd.accent-orange {
  color: var(--orange-text-dark);
  font-weight: 700;
}

.map__legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  width: fit-content;
  max-width: calc(100% - 32px);
  background: rgba(7, 11, 24, 0.82);
  border: 1px solid rgba(140, 165, 230, 0.18);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 11.5px;
  color: #c9d2ea;
  margin: 0;
  list-style: none;
}

.map__legend li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: none;
}

.swatch--high { background: var(--map-high); }
.swatch--mid { background: var(--map-mid); }
.swatch--low { background: var(--map-low); }
.swatch--none { background: var(--map-none); border: 1px solid #3a4a78; }
.swatch--pick { background: var(--map-pick); }

.map__legend .map__note {
  color: var(--muted);
}

@media (max-width: 560px) {
  .map__tag {
    display: none;
  }
  .map__card {
    width: auto;
    font-size: 11px;
    top: 5%;
    padding: 10px 12px;
    gap: 4px;
  }
  .map__card-name {
    font-size: 15px;
  }
  .map__card dl {
    font-size: 11px;
    gap: 4px 10px;
  }
  .map__legend {
    left: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
    font-size: 10.5px;
  }
}

/* ── 육각 아이콘 (동네 3유형 카드) ── */
.hexes {
  display: flex;
  gap: 6px;
}

.hex {
  width: 22px;
  height: 25px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--map-high);
}

.hex--pick { background: var(--orange-text-dark); }
.hex--low { background: var(--map-low); }
.hex--far { background: var(--map-far); }

.card__action {
  margin-top: auto;
  font-size: 13px;
  color: var(--indigo-4);
}

.card__action--pick {
  color: var(--orange-soft);
  font-weight: 700;
}

.card .h3 + p {
  color: var(--muted);
}

/* ── 계산기 구역 ── */
.calc-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: stretch;
}

.calc-intro {
  flex: 1 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.calc-intro .section-head {
  margin-bottom: 0;
}

.formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 16px;
  margin: 0;
}

.formula span {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 6px 10px;
}

.formula .op {
  background: none;
  padding: 0;
  color: var(--muted);
}

.formula .result {
  background: rgba(251, 146, 60, 0.18);
  color: var(--orange-soft);
  font-weight: 700;
}

.ward-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 12px;
  font-size: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ward-types li {
  border-left: 3px solid var(--indigo-2);
  padding: 4px 0 4px 12px;
}

.ward-types li span {
  display: block;
  color: var(--muted);
}

.ward-types .t-un { border-color: var(--orange-text-dark); }
.ward-types .t-sat { border-color: var(--map-high); }
.ward-types .t-far { border-color: #4a5578; }

.calc {
  flex: 1 1 420px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid rgba(140, 165, 230, 0.2);
  border-radius: var(--radius-l);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calc__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.calc__head h3 {
  font-size: 19px;
  font-weight: 700;
}

.calc__wards {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.calc__ward {
  background: transparent;
  color: #c9d2ea;
  border: 1px solid rgba(140, 165, 230, 0.28);
  border-radius: var(--radius-s);
  padding: 10px 16px;
  font: inherit;
  font-size: 14.5px;
  min-height: 44px;
  cursor: pointer;
}

.calc__ward[aria-pressed="true"] {
  background: var(--indigo);
  color: #ffffff;
  border-color: var(--indigo-2);
  font-weight: 700;
}

.calc__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.calc__stats div {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
}

.calc__stats dt {
  font-size: 12px;
  color: var(--muted);
}

.calc__stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.calc__note {
  font-size: 13px;
  color: var(--muted);
}

.calc__result {
  border-top: 1px dashed rgba(140, 165, 230, 0.24);
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.calc__result-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.calc__gap {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  color: var(--orange-text-dark);
  font-variant-numeric: tabular-nums;
}

.calc__gap small {
  font-size: 20px;
  font-weight: 700;
}

.calc__type {
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  background: var(--orange-wash);
  color: var(--orange-text-dark);
}

.calc[data-state="saturated"] .calc__gap,
.calc[data-state="saturated"] .calc__type {
  color: var(--indigo-3);
}

.calc[data-state="saturated"] .calc__type {
  background: rgba(99, 102, 241, 0.18);
}

@media (max-width: 480px) {
  .calc {
    padding: 20px;
  }
  .calc__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .calc__stats div:last-child {
    grid-column: 1 / -1;
  }
  .calc__gap {
    font-size: 44px;
  }
}
