/* =========================================================================
   xingAPI 소개 > 패키지 가이드 — one-page scroll
   hero · what&why · ecosystem cards · quick start timeline · tech specs
   lightbox · section dots
   ========================================================================= */

.pg { position: relative; }

/* section base */
.pg-sec { position: relative; padding-block: clamp(72px, 9vw, 120px); scroll-margin-top: 72px; }
.pg-sec__head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.pg-sec__head.center { margin-inline: auto; text-align: center; }
.pg-sec__head .eyebrow { margin-bottom: 16px; }
.pg-sec__head h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.pg-sec__head p { color: var(--text-2); font-size: var(--fs-text-md); line-height: var(--lh-text-md); margin-top: 14px; }

/* ---------- Section 1 — HERO ---------- */
.pg-hero { position: relative; overflow: hidden; padding-top: 150px; padding-bottom: clamp(70px, 8vw, 110px); border-bottom: 1px solid var(--border); background-color: var(--surface-blue); }
.pg-hero__glow { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: 0; }
.pg-hero__glow.g1 { width: 460px; height: 460px; top: -90px; right: 2%; background: radial-gradient(circle, var(--glow-cyan), transparent 66%); opacity: 0.4; }
.pg-hero__glow.g2 { width: 420px; height: 420px; bottom: -160px; left: 10%; background: radial-gradient(circle, var(--glow-navy), transparent 66%); opacity: 0.5; }
/* 카피(가운데 정렬) 위에, 아키텍처 다이어그램을 아래로 쌓는 세로 구성 */
.pg-hero__stack { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 3vw, 40px); }
.pg-hero__copy { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pg-hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin-bottom: 22px; }
.pg-hero__sub { color: var(--text-2); font-size: clamp(1.00rem, 1.5vw, 1.25rem); line-height: 1.6; max-width: 520px; }
.pg-hero__cta { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; justify-content: center; }
/* 좁은 화면에서는 버튼 안 아이콘을 뺀다(라벨만 남김) */
.pg-hero__cta-ic { width: 18px; height: 18px; }

/* architecture diagram — 이미지(원·화살표) + 코드로 그린 캡션.
   자체 제작 .arch 블록(코드로 그린 노드/화살표)을 원본의 다이어그램 이미지로 교체했다. */
.pg-hero__diagram { width: 100%; max-width: 780px; }
.pg-hero__diagram-crop { position: relative; width: 100%; }
.pg-hero__diagram-img { display: none; width: 100%; height: auto; }
/* data-theme 미지정(시스템 기본)은 다크로 동작하므로 :not([data-theme="dark"]) 로 라이트를 잡는다 */
:root[data-theme="dark"] .pg-hero__diagram-img.is-dark { display: block; }
:root:not([data-theme="dark"]) .pg-hero__diagram-img.is-light { display: block; }

.pg-hero__diagram-caps { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 11.5%; margin-top: -25px; }
.pg-hero__diagram-cap { text-align: center; font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); color: var(--text-2); }
.pg-hero__diagram-cap span { display: block; }
.pg-hero__diagram-cap.is-accent { color: var(--text-accent); font-weight: 600; }

@media (max-width: 980px) { .pg-hero__sub { max-width: none; } }
@media (max-width: 640px) { .pg-hero__cta-ic { display: none; } }

/* ---------- Section 2 — WHAT & WHY ---------- */
.ww-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
/* 대화형 말풍선 — 질문은 아바타와 함께 왼쪽 accent 버블, 답변은 오른쪽 서피스 버블.
   기존 카드형(.qa 에 border/padding, Q./A. 마커)을 원본 구조로 교체했다. */
.qa-list { display: flex; flex-direction: column; gap: 28px; }
.qa { display: flex; flex-direction: column; gap: 12px; }
.qa__q-row { display: flex; align-items: flex-end; gap: 10px; align-self: flex-start; max-width: 82%; }
.qa__avatar {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; background: var(--surface-2); color: var(--text-inactive);
}
.qa__avatar img { width: 100%; height: 100%; object-fit: cover; }
.qa__q {
  position: relative; flex: 1; min-width: 0;
  padding: 15px 20px; border-radius: var(--r-lg);
  background: var(--accent-prime); color: var(--on-accent);
  font-size: var(--fs-text-md); line-height: var(--lh-text-md); font-weight: 500; letter-spacing: -0.01em;
}
/* 말풍선 꼬리 */
.qa__q::after {
  content: ""; position: absolute; left: 2px; bottom: -3px;
  width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-top: 12px solid var(--accent-prime); transform: rotate(40deg);
}
.qa__a {
  align-self: flex-end; max-width: 82%;
  padding: 15px 20px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text-2); font-size: var(--fs-text-md); line-height: var(--lh-text-md); letter-spacing: -0.01em;
}

.feat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.feat { padding: 24px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); transition: transform 0.3s var(--ease), border-color 0.3s; }
.feat:hover { transform: translateY(-4px); border-color: var(--border-glow); }
.feat__ic { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; background: rgba(91,168,255,0.12); border: 1px solid rgba(91,168,255,0.3); color: var(--accent-prime); margin-bottom: 16px; }
.feat__ic svg { width: 24px; height: 24px; }
.feat h4 { font-size: var(--fs-text-md); line-height: var(--lh-text-md); font-weight: 700; margin-bottom: 7px; letter-spacing: -0.01em; }
.feat p { font-size: var(--fs-text-sm); color: var(--text-2); line-height: var(--lh-text-sm); }

@media (max-width: 920px) { .ww-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .qa__q, .qa__a { font-size: calc(1rem - 0.5pt); }
  /* 꼬리가 버블 자체의 라운드 코너에 먹히던 문제 — 모바일에서는 옆으로 빼서 살린다 */
  .qa__q::after {
    left: -5px; bottom: 6px;
    border-left: 0; border-right: 8px solid var(--accent-prime);
    border-top: 6px solid transparent; border-bottom: 6px solid transparent;
    transform: none;
  }
}
@media (max-width: 460px) {
  .feat-grid { grid-template-columns: 1fr; }
  .pg-hero__diagram-caps { margin-top: -5px; }
  .qa__avatar { width: 50px; height: 50px; }
}

/* ---------- Section 3 — ECOSYSTEM CARDS ---------- */
.eco-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; max-width: 760px; margin-inline: auto; }
.eco { display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-card); overflow: hidden; transition: transform 0.3s var(--ease), border-color 0.3s; }
.eco:hover { transform: translateY(-6px); border-color: var(--border-glow); }
.eco__preview { position: relative; height: 172px; overflow: hidden; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 0; background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.eco__preview::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 80% at 80% 0%, var(--surface-blue), transparent 60%); opacity: 0.9; }
.eco__win { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface); position: relative; z-index: 1; }
.eco__win-dots { display: flex; gap: 5px; }
.eco__win-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.eco__win-dots i:first-child { background: #ff5f57; } .eco__win-dots i:nth-child(2) { background: #febc2e; } .eco__win-dots i:nth-child(3) { background: #28c840; }
.eco__win-title { font-family: var(--font-sans); font-size: var(--fs-badge); line-height: var(--lh-badge); color: var(--text-dim); font-weight: 600; }
.eco__win-body { flex: 1; position: relative; z-index: 1; padding: 16px 18px; display: flex; align-items: center; justify-content: center; }
.eco__rows { width: 100%; display: flex; flex-direction: column; gap: 11px; }
.eco__rows span { display: block; height: 9px; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--surface-blue), transparent); border: 1px solid var(--border); position: relative; }
.eco__rows span::before { content: ""; position: absolute; left: 0; top: -1px; bottom: -1px; width: 30px; border-radius: var(--r-pill); background: var(--accent-prime); opacity: 0.9; }
.eco__spark { width: 100%; height: 100%; max-height: 96px; }
.eco__body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.eco__name { display: flex; align-items: center; gap: 10px; }
.eco__name b { font-size: var(--fs-title-sub); line-height: var(--lh-title-sub); font-weight: 800; letter-spacing: -0.02em; }
.eco__name .badge { font-family: var(--font-sans); font-size: var(--fs-badge); line-height: var(--lh-badge); color: var(--chip-text); padding: 3px 8px; border-radius: var(--r-pill); background: var(--chip-bg); border: 1px solid var(--chip-border); }
.eco__when { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); font-weight: 600; color: var(--accent-prime); }
.eco__when svg { width: 14px; height: 14px; flex-shrink: 0; }
.eco__desc { font-size: var(--fs-text-sm); color: var(--text-dim); line-height: var(--lh-text-sm); flex: 1; }
.eco__dl { margin-top: 4px; }

@media (max-width: 900px) { .eco-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; } }

/* ---------- Section 4 — QUICK START TIMELINE ---------- */
.qs-track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
.qs-step { position: relative; padding: 0 14px; }
.qs-step__top { display: flex; align-items: center; margin-bottom: 20px; }
.qs-step__num { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-sans); font-weight: 700; font-size: var(--fs-title-sub); line-height: var(--lh-title-sub); flex-shrink: 0; background: var(--surface-2); border: 1.5px solid var(--border-strong); color: var(--text-dim); transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s; z-index: 2; }
.qs-step.active .qs-step__num { background: var(--accent-prime); border-color: transparent; color: var(--on-accent); box-shadow: 0 0 0 5px rgba(52,225,255,0.14), 0 8px 22px -8px var(--glow-cyan); }
.qs-step__line { flex: 1; height: 2px; margin-left: 8px; background: var(--border); position: relative; overflow: hidden; }
.qs-step__line::after { content: ""; position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-prime)); transition: width 0.2s var(--ease); }
.qs-step.done .qs-step__line::after { width: 100%; }
.qs-step:last-child .qs-step__line { display: none; }
.qs-step__k { font-family: var(--font-sans); font-size: var(--fs-badge); line-height: var(--lh-badge); color: var(--chip-text); letter-spacing: 0.05em; }
.qs-step h4 { font-size: var(--fs-text-md); line-height: var(--lh-text-md); font-weight: 700; margin: 4px 0 8px; letter-spacing: -0.01em; }
.qs-step p { font-size: var(--fs-text-sm); color: var(--text-dim); line-height: var(--lh-text-sm); }

.qs-langs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: clamp(40px, 5vw, 60px); }
.qs-lang { font-family: var(--font-mono); font-size: 0.88rem; font-weight: 600; padding: 9px 18px; border-radius: var(--r-pill); color: var(--text-2); background: var(--surface); border: 1px solid var(--border-strong); transition: color 0.2s, border-color 0.2s, transform 0.2s var(--ease); }
.qs-lang:hover { color: var(--text); border-color: var(--border-glow); transform: translateY(-2px); }

@media (max-width: 860px) {
  .qs-track { grid-template-columns: 1fr; gap: 0; }
  .qs-step { padding: 0 0 28px 0; display: grid; grid-template-columns: 52px 1fr; gap: 18px; }
  .qs-step__top { flex-direction: column; margin-bottom: 0; }
  .qs-step__line { width: 2px; height: auto; flex: 1; margin: 8px 0 0; min-height: 24px; }
  .qs-step__line::after { width: 100% !important; height: 0; transition: height 0.5s var(--ease); }
  .qs-step.done .qs-step__line::after { height: 100%; }
  .qs-step:last-child .qs-step__line { display: none; }
}

/* ---------- Section 5 — TECH SPECS ---------- */
.specs-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; font-size: var(--fs-text-md); line-height: var(--lh-text-md); }
.specs-table tr { transition: background-color 0.16s; }
.specs-table tr:hover { background: var(--surface); }
.specs-table th { text-align: left; padding: 16px 22px; background: var(--surface-2); font-weight: 700; color: var(--text); width: 200px; white-space: nowrap; border-bottom: 1px solid var(--border); vertical-align: top; }
.specs-table td { padding: 16px 22px; color: var(--text-2); border-bottom: 1px solid var(--border); line-height: 1.6; }
.specs-table tr:last-child th, .specs-table tr:last-child td { border-bottom: none; }
.specs-table code { font-family: var(--font-mono); font-size: var(--fs-code-chip); line-height: var(--lh-code-chip); color: var(--chip-text); background: var(--chip-bg); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--chip-border); }

@media (max-width: 620px) {
  .specs-table, .specs-table tbody, .specs-table tr, .specs-table th, .specs-table td { display: block; width: auto; }
  .specs-table th { border-bottom: none; padding-bottom: 4px; }
  .specs-table td { padding-top: 4px; padding-bottom: 16px; }
}

/* ---------- lightbox ---------- */
.lbx { position: fixed; inset: 0; z-index: 210; display: flex; align-items: center; justify-content: center; padding: 32px; opacity: 0; pointer-events: none; transition: opacity 0.28s var(--ease); }
.lbx.show { opacity: 1; pointer-events: auto; }
.lbx__backdrop { position: absolute; inset: 0; background: rgba(4,7,14,0.84); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.lbx__inner { position: relative; z-index: 1; max-width: min(1100px, 92vw); max-height: 88vh; transform: scale(0.96); transition: transform 0.3s var(--ease-out); display: flex; flex-direction: column; }
.lbx.show .lbx__inner { transform: none; }
.lbx__img { max-width: 100%; max-height: 80vh; border-radius: var(--r-md); border: 1px solid var(--border-strong); box-shadow: var(--shadow-float); object-fit: contain; background: #0a0e1a; }
.lbx__cap { text-align: center; color: var(--text-2); font-size: var(--fs-text-sm); line-height: var(--lh-text-sm); margin-top: 14px; font-weight: 500; }
.lbx__x { position: absolute; top: -8px; right: -8px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-solid); border: 1px solid var(--border-strong); color: var(--text); box-shadow: var(--shadow-float); transition: transform 0.2s, color 0.2s; }
.lbx__x:hover { transform: scale(1.08); color: var(--accent-prime); }
.lbx__x svg { width: 20px; height: 20px; }
@media (max-width: 600px) {
  .lbx { padding: 0; }
  .lbx__inner { max-width: 100vw; max-height: 100vh; width: 100%; height: 100%; justify-content: center; }
  .lbx__img { max-height: 90vh; border-radius: 0; }
  .lbx__x { top: 16px; right: 16px; }
}
