/*
 * fonts.css — WOORI 웹폰트
 *
 * ── 무엇을 왜 쓰나 ────────────────────────────────────────────────
 *   본문·화면 전체   Pretendard Variable   — 한 파일(2.0MB)로 굵기 45~920 전부.
 *                                           숫자 폭이 고르고 한글 자간이 촘촘해 표가 잘 읽힌다.
 *   숫자·코드        JetBrains Mono        — 단가·수량·코드처럼 «자리»가 맞아야 하는 곳.
 *   받침(fallback)   Noto Sans KR          — 폰트가 못 뜰 때. 파일이 이미 있다.
 *
 * ★ 모두 «내려받아» 둔다 — 밖(CDN)을 보지 않는다. 사내망이 끊겨도 글씨가 바뀌지 않는다.
 * ★ font-display: swap — 폰트를 기다리며 «글씨가 안 보이는» 일이 없게. 받침으로 먼저 보여 준다.
 */

/* ── 본문 — 가변 폰트 한 벌 ─────────────────────────────────────── */
@font-face {
  font-family: 'Pretendard Variable';
  font-style: normal;
  font-weight: 45 920;              /* 가변 — 300·400·500·600·700 을 이 한 파일이 다 낸다 */
  font-display: swap;
  src: url('/fonts/PretendardVariable.woff2') format('woff2-variations');
}

/* ── 숫자·코드 ──────────────────────────────────────────────────── */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/jetbrains-400.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/jetbrains-500.woff2') format('woff2'); }

/* ── 받침 ───────────────────────────────────────────────────────── */
@font-face { font-family: 'Noto Sans KR'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/notosanskr-400.woff2') format('woff2'), url('/fonts/notosanskr-lat-400.woff2') format('woff2'); }
@font-face { font-family: 'Noto Sans KR'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/fonts/notosanskr-500.woff2') format('woff2'), url('/fonts/notosanskr-lat-500.woff2') format('woff2'); }
@font-face { font-family: 'Noto Sans KR'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/notosanskr-700.woff2') format('woff2'), url('/fonts/notosanskr-lat-700.woff2') format('woff2'); }

:root {
  --font-sans:    'Pretendard Variable', Pretendard, 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ko:      var(--font-sans);
  --font-display: var(--font-sans);
  --font-mono:    'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, monospace;
}

body {
  font-family: var(--font-sans);
  /* 한글은 자간을 아주 조금 좁혀야 덩어리로 읽힌다. 너무 좁히면 «ㅁㅇㅂ» 이 붙어 보인다 */
  letter-spacing: -0.004em;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* 숫자는 어디서나 «세로줄이 맞게» — 표에서 자리가 흔들리지 않는다 */
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'case' 1;
}

/* 제목은 조금 더 좁게 — 큰 글씨일수록 빈틈이 커 보인다 */
h1, h2, h3, .stat-value, .kpi .v { letter-spacing: -0.018em; }
h1 { line-height: 1.25; }
h2, h3 { line-height: 1.35; }

/* 숫자·코드 자리 */
code, .mono, pre, .num-mono { font-family: var(--font-mono); font-feature-settings: 'tnum' 1; }
td, .stat-value, .oc-count, .amt, .price, .num { font-variant-numeric: tabular-nums; }

/* 아주 작은 글씨(딱지·꼬리말)는 자간을 되돌린다 — 좁히면 뭉개진다 */
.tag, .ch, .badge, .only-tag, .low-tag, .stat, .hint, .sub, .desc, .ds, .note {
  letter-spacing: 0;
}
