/* Pretendard Variable 부분 글꼴(한글 완성형 2,350자 + 영문/기호 + 사이트에 쓰인 글자, 굵기 400-800). 만드는 법: tools/font/build_font.py
   범위 밖 글자는 --font의 대체 글꼴로 보인다. 한 파일이라 글꼴 선택 계산과 교체(재배치)가 한 번이다. */
/* 숫자·시세용 고정폭 글꼴: Inconsolata (SIL OFL, 영문/숫자/기호만). 기기마다 달랐던 고정폭 글꼴(Windows는 Consolas, 폰은 기본 monospace)을 한 파일로 통일한다. 한글은 --mono에서 Pretendard로 이어진다. */
@font-face { font-family: "Inconsolata"; font-weight: 200 900; font-style: normal; font-display: swap; src: url("../fonts/inconsolata-latin-wght.woff2") format("woff2"); }
@font-face { font-family: "Pretendard Variable"; font-weight: 400 800; font-style: normal; font-display: swap; src: url("../fonts/pretendard-ko.woff2") format("woff2"); }

/* JB-Ai-Lab site.css
   단일 디자인 시스템 (SSOT). 모든 페이지는 이 파일의 토큰만 사용한다.
   방향: 흰 바탕, 먹색 글자, 단일 액센트(딥 그린), 넉넉한 여백, 큰 타이포 위계. */

:root {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --sunken: #f2f3f4;
  --ink: #111214;
  --ink-2: #44474d;
  --mute: #6b6f76;
  --line: #e4e5e8;
  --line-strong: #cfd1d6;
  --accent: #0f6b4f;
  --accent-ink: #ffffff;
  --accent-soft: #e6f2ed;
  --up: #c4352b;      /* 한국 시장 관례: 상승 = 적색 */
  --down: #1d5fc4;    /* 하락 = 청색 */
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;

  --radius: 14px;     /* 카드, 입력 */
  --radius-pill: 999px; /* 버튼, 칩 */

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --mono: "Inconsolata", "Pretendard Variable", monospace;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 56px);
  --nav-h: 68px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0f11; --surface: #16171a; --sunken: #1c1d21; --ink: #f1f2f3; --ink-2: #c3c6cb;
  --mute: #8d9199; --line: #26282d; --line-strong: #383b42; --accent: #4fc197; --accent-ink: #07110d;
  --accent-soft: #14261f; --up: #ff7b70; --down: #7aa8f5; --warn: #e5b255; --warn-soft: #2a2110;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.65;
  font-feature-settings: "ss05"; word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
code, pre, kbd, samp { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mute { color: var(--mute); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 타이포 */
.display { font-size: clamp(2.25rem, 5.4vw, 4.25rem); line-height: 1.12; letter-spacing: -0.035em; font-weight: 700; margin: 0; }
.h2 { font-size: clamp(1.6rem, 3.2vw, 2.5rem); line-height: 1.2; letter-spacing: -0.03em; font-weight: 700; margin: 0; }
.h3 { font-size: 1.2rem; line-height: 1.4; letter-spacing: -0.02em; font-weight: 650; margin: 0; }
.lead { font-size: clamp(1.02rem, 1.5vw, 1.2rem); color: var(--ink-2); max-width: 60ch; margin: 0; }
.eyebrow { font-size: 0.8125rem; letter-spacing: 0.02em; color: var(--mute); font-weight: 600; margin: 0 0 14px; }
p { margin: 0; }

/* 버튼 (pill) */
.btn {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  padding: 14px 24px; border-radius: var(--radius-pill); border: 1px solid var(--ink);
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 0.95rem;
  transition: transform .25s var(--ease), background .25s, color .25s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--sm { padding: 9px 16px; font-size: .85rem; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; border-bottom: 1px solid var(--ink); padding-bottom: 3px; }
.link-arrow:hover { gap: 12px; transition: gap .25s var(--ease); }

/* 헤더 */
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-weight: 800; letter-spacing: -0.04em; font-size: 1.15rem; }
.brand span { color: var(--accent); }
.nav { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); }
.nav a { font-size: .95rem; color: var(--ink-2); padding: 6px 0; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); padding: 8px 14px; font-size: .85rem; }
@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav { position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 4px;
         background: var(--bg); padding: 12px var(--gutter) 24px; border-bottom: 1px solid var(--line); display: none; }
  .nav[data-open="true"] { display: flex; }
  .nav a { font-size: 1.1rem; padding: 10px 0; width: 100%; }
}

/* 푸터 */
.site-footer { border-top: 1px solid var(--line); margin-top: 120px; padding: 56px 0 48px; color: var(--mute); font-size: .875rem; }
.site-footer .wrap { display: grid; gap: 32px; grid-template-columns: 1.4fr 1fr; align-items: start; }
.site-footer .links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: flex-end; }
.site-footer .links a:hover { color: var(--ink); }
.site-footer .fine { grid-column: 1 / -1; font-size: .8rem; }
@media (max-width: 720px) { .site-footer .wrap { grid-template-columns: 1fr; } .site-footer .links { justify-content: flex-start; } }

/* 섹션 리듬 */
.section { padding-block: clamp(56px, 8vw, 104px); }
.section--tight { padding-block: clamp(32px, 4.5vw, 64px); }
.section--tight + .section--tight { padding-top: 0; }
.section--sunken { background: var(--sunken); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* 카드 (필요할 때만) */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }

/* 배지 */
.chip { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.chip--live { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip--plan { background: var(--warn-soft); border-color: transparent; color: var(--warn); }

/* 스크롤 리빌: IntersectionObserver가 .is-in 부여 */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0ms); }
  [data-reveal].is-in { opacity: 1; transform: none; }
}

/* 테마 토글 (라이트 기본, 선택은 localStorage에 저장) */
.theme-toggle { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); padding: 7px 14px; font-size: .82rem; font-weight: 600; color: var(--ink-2); transition: border-color .2s, color .2s; white-space: nowrap; }
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.site-header .actions { display: flex; align-items: center; gap: 12px; }
