/* ═══════════════════════════════════════════════════════════
   ORBIT (함께 성장 — 선순환 구조) — orbit.css  [1단계: 구조 + 콘텐츠 전환]
   · 가운데 큰 원(선택 항목 제목+설명) + 둘레 작은 원 4개(궤도 배치)
   · 정적 점선 궤도(라인 애니메이션은 2단계 — 이번 제외)
   · hover/자동순환 시 가운데 콘텐츠 fade swap (orbit.js)
   · 흰 배경 + 연노랑/골드. 검정·빨강·이모지 금지.
   · 모바일: 궤도 해제 → 탭 리스트 + 아래 콘텐츠.
═══════════════════════════════════════════════════════════ */

.orbit {
  scroll-margin-top: 80px;
}
.orbit__head {
  text-align: center;
  margin-bottom: 24px;
}
/* "선순환 구조" — 글자별 웨이브(선→순→환→구→조 순서로 커졌다 작아짐, 무한 루프). 은은·가독성 유지 */
.orbit-wave span {
  display: inline-block;
  transform-origin: center bottom;
  animation: orbitCharWave 2.4s ease-in-out infinite;
}
.orbit-wave span:nth-child(1) {
  animation-delay: 0s;
}
.orbit-wave span:nth-child(2) {
  animation-delay: 0.15s;
}
.orbit-wave span:nth-child(3) {
  animation-delay: 0.3s;
}
.orbit-wave span:nth-child(4) {
  animation-delay: 0.45s;
}
.orbit-wave span:nth-child(5) {
  animation-delay: 0.6s;
}
@keyframes orbitCharWave {
  0% {
    transform: scale(1);
  }
  12% {
    transform: scale(1.25); /* 솟았다가 */
  }
  28% {
    transform: scale(1); /* 다시 안착 → 이후 휴지(다음 루프까지) */
  }
  100% {
    transform: scale(1);
  }
}

/* ── 무대(궤도 영역) ── */
.orbit__stage {
  position: relative;
  width: clamp(360px, 62vw, 720px);
  aspect-ratio: 100 / 58; /* 반달 아치용 가로 긴 무대 */
  margin: 72px auto 48px;
}

/* ── bhc식 반달 아치 궤도 (SVG) ── */
.orbit__arc {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0; /* 원/위성 뒤 */
}
/* 정적 호(은은한 골드 실선) — 작은 원들이 이 호에 매달린 모양 */
.orbit__arc-base {
  fill: none;
  stroke: color-mix(in srgb, var(--gold, #f0c000) 40%, #ffffff);
  stroke-width: 1.6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
/* 2단계: 호를 따라 흐르는 빛(점선 + dashoffset 이동) — 평소 숨김 */
.orbit__arc-flow {
  fill: none;
  stroke: var(--gold, #f0c000);
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-dasharray: 2.5 22; /* 작은 점 + 긴 공백 → 흐르는 빛 */
  vector-effect: non-scaling-stroke;
  opacity: 0;
}
/* hover 시 라인 흐름 — 과하지 않게 */
.orbit__stage:hover .orbit__arc-flow {
  opacity: 0.9;
  animation: orbit-flow 1.6s linear infinite;
}
/* 활성(자동순환 포함) 시 라인 흐름 — :has 분리(미지원 엔진서 hover 규칙은 유지) */
.orbit__stage:has(.orbit__sat.is-active) .orbit__arc-flow {
  opacity: 0.9;
  animation: orbit-flow 1.6s linear infinite;
}
@keyframes orbit-flow {
  from {
    stroke-dashoffset: 24.5; /* 한 주기(2.5+22) */
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* ── 가운데 큰 원 ── */
.orbit__center {
  position: absolute;
  left: 50%;
  top: 64%; /* 반달 아치 아래로 내려 배치 */
  transform: translate(-50%, -50%);
  width: clamp(168px, 26vw, 252px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: var(--color-card, #ffffff); /* 연노랑 챕터 밴드 위에서 또렷하게(원 강화) */
  border: 1.5px solid color-mix(in srgb, var(--gold, #f0c000) 45%, #ffffff);
  box-shadow: 0 14px 34px rgba(240, 192, 0, 0.18);
  z-index: 2;
}
/* 가운데 큰 원 — 동심원 파동(골드 링, 무한 천천히). #solution 카운터 파동 패턴 참고 */
.orbit__center::before,
.orbit__center::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--gold, #f0c000);
  opacity: 0;
  z-index: -1; /* 원 뒤 → 가장자리에서 바깥으로 퍼지는 링 */
  pointer-events: none;
  will-change: transform, opacity;
  animation: orbitCenterWave 3.8s ease-out infinite;
}
.orbit__center::after {
  animation-delay: 1.9s; /* 두 번째 링 — 절반 주기 뒤(끊김 없는 파동) */
}
@keyframes orbitCenterWave {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}
.orbit__center-inner {
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}
.orbit__center-inner.is-swapping {
  opacity: 0;
  transform: translateY(6px);
}
.orbit__center-title {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  font-weight: 800;
  color: var(--gold-dark, #c9a000);
  margin: 0 0 8px;
  word-break: keep-all;
}
.orbit__center-desc {
  font-size: clamp(0.84rem, 1.2vw, 0.95rem);
  line-height: 1.6;
  color: var(--color-text-sub, #555);
  margin: 0;
  word-break: keep-all;
}

/* ── 작은 원 4개 (PC: 궤도 절대배치 / display:contents 로 stage 기준 배치) ── */
.orbit__sats {
  display: contents;
}
.orbit__sat {
  position: absolute;
  transform: translate(-50%, -50%);
  width: clamp(112px, 14vw, 156px); /* 궤도 작은 원 확대 */
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: #ffffff;
  border: 1.5px solid color-mix(in srgb, var(--gold, #f0c000) 34%, #ffffff);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  color: var(--gold, #f0c000); /* SVG currentColor */
  cursor: pointer;
  z-index: 3;
  transition:
    transform 0.3s ease,
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}
/* 궤도 위치 — 반달 아치 위에 좌→우 분포(1·4 바깥 낮게, 2·3 안쪽 높게) */
.orbit__sat--1 {
  left: 11%;
  top: 22%;
}
.orbit__sat--2 {
  left: 38%;
  top: 7.5%;
}
.orbit__sat--3 {
  left: 62%;
  top: 7.5%;
}
.orbit__sat--4 {
  left: 89%;
  top: 22%;
}

.orbit__sat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.orbit__sat-icon svg {
  width: clamp(30px, 3.9vw, 40px);
  height: clamp(30px, 3.9vw, 40px);
  display: block;
}
.orbit__sat-label {
  font-size: clamp(0.74rem, 1.1vw, 0.88rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text, #1a1a1a);
  word-break: keep-all;
  text-align: center;
}

/* 활성 / hover(PC) — 골드 강조 + 살짝 확장 (translate 유지) */
.orbit__sat.is-active,
.orbit__sat:hover {
  background: radial-gradient(
    circle at 32% 28%,
    #ffe27a 0%,
    var(--gold, #f0c000) 62%,
    var(--gold-dark, #c9a000) 100%
  );
  border-color: var(--gold, #f0c000);
  box-shadow: 0 12px 26px rgba(240, 192, 0, 0.34);
  transform: translate(-50%, -50%) scale(1.06);
  color: #1a1a1a; /* 골드 배경 위 아이콘 진하게 */
}
.orbit__sat.is-active .orbit__sat-label,
.orbit__sat:hover .orbit__sat-label {
  color: #1a1a1a;
}

/* ── prefers-reduced-motion: 전환·확장 정지(정적) ── */
@media (prefers-reduced-motion: reduce) {
  .orbit__center-inner {
    transition: none !important;
  }
  .orbit__sat {
    transition: none !important;
  }
  .orbit__sat.is-active,
  .orbit__sat:hover {
    transform: translate(-50%, -50%) !important;
  }
  /* 라인 흐름 정지 */
  .orbit__arc-flow {
    animation: none !important;
    opacity: 0 !important;
  }
  /* 제목 글자 웨이브 정지 */
  .orbit-wave span {
    animation: none !important;
    transform: none !important;
  }
  /* 가운데 원 파동 정지 */
  .orbit__center::before,
  .orbit__center::after {
    animation: none !important;
    opacity: 0 !important;
  }
}

/* ══════════════════════════════════════════════════════════
   모바일 (≤820px) — 궤도 해제 → 탭 리스트 + 아래 콘텐츠
══════════════════════════════════════════════════════════ */
@media (max-width: 820px) {
  .orbit__stage {
    width: 100%;
    max-width: 480px;
    aspect-ratio: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 24px auto 0;
  }
  .orbit__arc {
    display: none; /* 모바일: 반달 궤도 해제(데스크톱 전용) */
  }
  /* 탭(작은 원) 가로 2×2 그리드 — 44px 터치 보장 */
  .orbit__sats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    order: 1;
  }
  .orbit__sat {
    position: static;
    transform: none;
    width: 100%;
    aspect-ratio: auto;
    min-height: 88px;
    flex-direction: row;
    gap: 12px;
    border-radius: 16px;
    padding: 14px 16px;
  }
  .orbit__sat.is-active,
  .orbit__sat:hover {
    transform: none; /* 탭에선 확장 대신 색만 */
  }
  .orbit__sat-label {
    text-align: left;
  }
  /* 가운데 콘텐츠 — 탭 아래, 박스로 */
  .orbit__center {
    position: static;
    transform: none;
    order: 2;
    width: 100%;
    aspect-ratio: auto;
    min-height: 120px;
    border-radius: 18px;
  }
}

@media (prefers-reduced-motion: reduce) and (max-width: 820px) {
  .orbit__sat.is-active,
  .orbit__sat:hover {
    transform: none !important;
  }
}
