/* =================================================================
   roi-section.css
   §9 RELATIONSHIP ROI — Ultra Minimal Financial Visualization

   원칙:
     - 모든 클래스 relationship-roi- prefix
     - 두 개 바의 크기 차이가 곧 메시지 → 텍스트 최소화
     - 화이트 + 라이트그린 + 다크그린 포인트
     - subtle motion only (느린 width transition + fade)
   ================================================================= */

.relationship-roi-section {
  position: relative;
  padding: 140px 0;
  background: #ffffff;
  color: var(--ink);
  overflow: hidden;
}
.relationship-roi-section::before,
.relationship-roi-section::after {
  content: '';
  position: absolute;
  left: 0; right: 0; height: 1px;
  background: var(--line);
  pointer-events: none;
}
.relationship-roi-section::before { top: 0; }
.relationship-roi-section::after  { bottom: 0; }

.relationship-roi-inner {
  position: relative;
  max-width: 920px;
  z-index: 1;
}

/* ── Header ──────────────────────────────────────── */
.relationship-roi-head {
  margin-bottom: 44px;
  max-width: 640px;
}
.relationship-roi-kicker {
  display: inline-block;
  margin: 0 0 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--green-700);
  text-transform: uppercase;
}
.relationship-roi-title {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.028em;
  color: var(--green-ink);
  word-break: keep-all;
  text-wrap: balance;
}

/* =================================================================
   Stage — 동일 트랙 위 2개 row
   ================================================================= */
.relationship-roi-stage {
  display: flex;
  flex-direction: column;
  margin-bottom: 56px;
}

.relationship-roi-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 0;
}
.relationship-roi-row-emphasis {
  padding-bottom: 28px;
}

.relationship-roi-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.relationship-roi-row-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.relationship-roi-row-emphasis .relationship-roi-row-label {
  color: var(--green-700);
}

.relationship-roi-row-value {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .8s var(--ease) .15s, transform .8s var(--ease) .15s;
}
.relationship-roi-row-currency {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 2px;
}
.relationship-roi-row-amount {
  letter-spacing: -0.02em;
}
.relationship-roi-row-value-emphasis {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--green-ink);
  letter-spacing: -0.018em;
}
.relationship-roi-multiple {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-weight: 800;
  letter-spacing: -0.005em;
}

.relationship-roi-row-foot {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity .8s var(--ease) .35s;
}

/* ── Track + Bar ─────────────────────────────────── */
.relationship-roi-track {
  position: relative;
  width: 100%;
  height: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.relationship-roi-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  border-radius: 999px;
}
/* 작은 비용 바 — 라이트그린, 차분 */
.relationship-roi-bar-cost {
  background: #CFEADD;
  border-right: 1px solid var(--green-500);
  transition: width 1.2s cubic-bezier(.22,1,.36,1) .1s;
}
/* 큰 가치 바 — 다크그린, 강조 */
.relationship-roi-bar-value {
  background: linear-gradient(to right, var(--green-700), var(--green-ink));
  transition: width 1.6s cubic-bezier(.22,1,.36,1) .9s;
}

/* ── Connector — 두 row 사이 작은 vertical hairline ─ */
.relationship-roi-connector {
  display: flex;
  justify-content: flex-start;
  padding-left: 28px;
}
.relationship-roi-connector-line {
  display: block;
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, var(--green-100), var(--green-600));
  opacity: 0;
  transform: scaleY(0);
  transform-origin: top;
  transition: opacity .5s var(--ease) .55s, transform .9s cubic-bezier(.22,1,.36,1) .55s;
}

/* ── Caption — 마지막 fade in ────────────────────── */
.relationship-roi-caption {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--muted);
  letter-spacing: -0.005em;
  word-break: keep-all;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .9s var(--ease) 1.7s, transform .9s var(--ease) 1.7s;
}
.relationship-roi-caption em {
  font-style: normal;
  font-weight: 700;
  color: var(--green-ink);
  position: relative;
  display: inline-block;
}
.relationship-roi-caption em::after {
  content: '';
  position: absolute;
  left: -2px; right: -2px; bottom: 2px;
  height: 10px;
  background: var(--green-100);
  z-index: -1;
  border-radius: 2px;
}

/* =================================================================
   Active state — JS 가 stage 에 .is-active 부여
   ================================================================= */
.relationship-roi-stage.is-active .relationship-roi-bar-cost  { width: 8%; }
.relationship-roi-stage.is-active .relationship-roi-bar-value { width: 100%; }
.relationship-roi-stage.is-active .relationship-roi-row-value,
.relationship-roi-stage.is-active .relationship-roi-row-foot {
  opacity: 1;
  transform: none;
}
.relationship-roi-stage.is-active .relationship-roi-connector-line {
  opacity: 1;
  transform: scaleY(1);
}
/* row-emphasis 쪽은 큰 바 등장 후에 value 가 나타나야 함 */
.relationship-roi-stage.is-active .relationship-roi-row-emphasis .relationship-roi-row-value {
  transition-delay: 1.45s;
}
.relationship-roi-stage.is-active .relationship-roi-row-emphasis .relationship-roi-row-foot {
  transition-delay: 1.65s;
}

.relationship-roi-caption.is-active {
  opacity: 1;
  transform: none;
}

/* =================================================================
   Responsive
   ================================================================= */
@media (max-width: 720px) {
  .relationship-roi-section { padding: 96px 0; }
  .relationship-roi-head    { margin-bottom: 48px; }
  .relationship-roi-title   { font-size: 28px; }

  .relationship-roi-row { padding: 18px 0; gap: 10px; }
  .relationship-roi-row-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .relationship-roi-row-value { font-size: 18px; }
  .relationship-roi-row-value-emphasis { font-size: 18px; }
  .relationship-roi-track { height: 14px; }
  .relationship-roi-connector { padding-left: 16px; }
  .relationship-roi-connector-line { height: 24px; }

  .relationship-roi-caption { font-size: 15px; }
}

/* =================================================================
   Reduced motion — 전부 정적 표시
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
  .relationship-roi-bar-cost,
  .relationship-roi-bar-value,
  .relationship-roi-row-value,
  .relationship-roi-row-foot,
  .relationship-roi-connector-line,
  .relationship-roi-caption {
    transition: none !important;
  }
  .relationship-roi-stage .relationship-roi-bar-cost  { width: 8%; }
  .relationship-roi-stage .relationship-roi-bar-value { width: 100%; }
  .relationship-roi-row-value,
  .relationship-roi-row-foot,
  .relationship-roi-caption {
    opacity: 1;
    transform: none;
  }
  .relationship-roi-connector-line { opacity: 1; transform: scaleY(1); }
}
