/* ──────────────────────────────────────────────────────────────────────────
 * site.css — 공개 사이트(소개·다운로드·문서) 전용 스타일.
 * 콘솔 style.css와 완전 분리한다(콘솔의 body{display:flex} 등 전역 규칙이 새 레이아웃을
 * 망가뜨리던 문제 해결). 테마 토큰은 여기서 자체 정의(콘솔과 동일 팔레트 — CEREBRO Edge).
 * ────────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #f8fafc;
  --bg-2: #f1f5f9;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-dim: #334155;
  --text-faint: #64748b;
  --accent: #ff3b30; --on-solid: #ffffff;
  --accent-hover: #e03126;
  --accent-soft: #fff2f1;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "D2Coding", monospace;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .02);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .08), 0 2px 4px -1px rgba(0, 0, 0, .03);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, .05), 0 4px 6px -2px rgba(15, 23, 42, .02);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, .1), 0 10px 10px -5px rgba(15, 23, 42, .04);
  --focus-ring: rgba(255, 59, 48, .12);
}
/* 다크 테마 — 명시 선택(theme-dark) 또는 시스템이 다크일 때(theme-system).
   값은 아래 두 블록에서 1:1 동일 — 한쪽만 고치지 말 것. */
html.theme-dark {
  --bg: #0b1220; --bg-2: #0f172a; --panel: #141d2e; --panel-soft: #172033;
  --border: #ffffff14; --border-strong: #ffffff2e;
  --text: #e2e8f0; --text-dim: #94a3b8; --text-faint: #64748b;
  --accent: #ff5a4d; --on-solid: #ffffff;
  --accent-hover: #ff7367;
  --accent-soft: #3a1a17;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, .55);
  --shadow-lg: 0 12px 24px -6px rgba(0, 0, 0, .6);
  --shadow-xl: 0 24px 60px -12px rgba(0, 0, 0, .7);
  --focus-ring: rgba(255, 90, 77, .30);
}
@media (prefers-color-scheme: dark) {
  /* 다크 값은 위 html.theme-dark 블록과 1:1 동일 — 한쪽만 고치지 말 것 */
  html.theme-system {
    --bg: #0b1220; --bg-2: #0f172a; --panel: #141d2e; --panel-soft: #172033;
    --border: #ffffff14; --border-strong: #ffffff2e;
    --text: #e2e8f0; --text-dim: #94a3b8; --text-faint: #64748b;
    --accent: #ff5a4d; --on-solid: #ffffff;
    --accent-hover: #ff7367;
    --accent-soft: #3a1a17;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .5);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, .55);
    --shadow-lg: 0 12px 24px -6px rgba(0, 0, 0, .6);
    --shadow-xl: 0 24px 60px -12px rgba(0, 0, 0, .7);
    --focus-ring: rgba(255, 90, 77, .30);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
img { max-width: 100%; }
a { color: inherit; }

/* ── 스크롤바(테마 연동 얇은 스크롤바 — style.css와 동일 규칙) ── */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ── 공용 헤더 ── */
/* 웹 컴포넌트 래퍼(커스텀 엘리먼트)는 기본 inline → 내부 헤더/푸터 블록 레이아웃 유지 위해 block */
site-header, site-footer { display: block; }
.site-header {
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px; height: 60px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--panel); z-index: 10;
}
.site-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); font-size: 17px; letter-spacing: -0.2px; white-space: nowrap; }
.site-logo img { width: 26px; height: 26px; border-radius: 6px; }
.site-logo b { color: var(--accent); font-weight: 700; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--text-dim); text-decoration: none; font-size: 14px; white-space: nowrap; }
.site-nav a:hover { color: var(--text); }
.site-nav a.site-dl { background: var(--accent); color: var(--on-solid); font-weight: 600; padding: 8px 16px; border-radius: 7px; }
.site-nav a.site-dl:hover { background: var(--accent-hover); color: var(--on-solid); }

/* ── 공용 푸터(회사 로고 + 시스템 문의) ── */
.site-footer { border-top: 1px solid var(--border); margin-top: 72px; padding: 26px 24px; }
.site-footer-inner { max-width: 920px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* 로고는 흰 칩 위에 — 라이트/다크 어느 테마에서도 로고 내부 글자가 가려지지 않게 */
.foot-logo { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; padding: 7px 12px; line-height: 0; }
.foot-logo img { height: 22px; width: auto; display: block; }
.foot-company { color: var(--text-faint); font-size: 13px; }
.foot-sep { color: var(--border-strong); font-size: 13px; }
/* 시스템 문의 — 회사명과 동일 글꼴(text-faint·13px)로, 로고 옆 왼쪽에 배치(우측 밀어내기 제거) */
.foot-contact { color: var(--text-faint); font-size: 13px; }
.foot-contact b { color: var(--accent); font-weight: 600; }
.foot-contact a { text-decoration: none; }

/* ── 랜딩(소개) — 히어로 2단 · 기능 3분할 · 시작 단계 · CTA 밴드 ── */
.lp { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* 공용 버튼(히어로·CTA 밴드 공유) */
.btn-primary, .btn-ghost {
  text-decoration: none; font-weight: 600; font-size: 15px; border-radius: var(--radius);
  padding: 12px 24px; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
  transition: all .2s cubic-bezier(.4, 0, .2, 1); border: 0;
}
.btn-primary { background: var(--accent); color: var(--on-solid); }
.btn-primary:hover {
  background: var(--accent-hover); color: var(--on-solid);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px color-mix(in srgb, var(--accent) 40%, transparent);
}
.btn-ghost { border: 1px solid var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* 히어로 */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 76px 0 68px; }
.hero-eyebrow { display: block; font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 16px; letter-spacing: -0.2px; }
.hero h1 { font-size: 48px; line-height: 1.1; letter-spacing: -1.3px; font-weight: 700; margin: 0 0 20px; word-break: keep-all; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero .lead { color: var(--text-dim); font-size: 17px; line-height: 1.7; margin: 0 0 30px; max-width: 520px; word-break: keep-all; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* 히어로 비주얼 — 실제 데스크톱 앱 실행 화면 영상을 창 프레임(신호등 바)으로 감싼다(방향 F) */
.hero-mock {
  border-radius: var(--radius-lg); border: 1px solid var(--border); overflow: hidden;
  box-shadow: var(--shadow-xl); background: var(--panel);
}
.hero-mock-bar { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; background: var(--panel-soft); border-bottom: 1px solid var(--border); }
.hero-mock-bar .dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.hero-mock-bar .dot:nth-child(1) { background: #ff5f56; }
.hero-mock-bar .dot:nth-child(2) { background: #ffbd2e; }
.hero-mock-bar .dot:nth-child(3) { background: #27c93f; }
.hero-mock .hero-shot { border: 0; border-radius: 0; box-shadow: none; }
.hero-shot { display: block; width: 100%; height: auto; }

/* 시작 3단계 */
.steps { border-top: 1px solid var(--border); padding: 60px 0; }
.steps-head { text-align: center; margin-bottom: 38px; }
.steps-head h2 { font-size: 28px; letter-spacing: -0.6px; margin: 0 0 10px; }
.steps-head p { color: var(--text-dim); font-size: 15px; margin: 0; word-break: keep-all; }
.steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { padding: 24px 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-sm); transition: all .2s cubic-bezier(.4, 0, .2, 1); }
.step:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.step .num { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--accent); }
.step h3 { font-size: 16px; margin: 10px 0 6px; letter-spacing: -0.2px; }
.step p { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin: 0; word-break: keep-all; }

/* CTA 밴드 */
.cta-band { text-align: center; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-2); padding: 56px 24px; margin: 4px 0 8px; box-shadow: var(--shadow-sm); }
.cta-band h2 { font-size: 27px; letter-spacing: -0.6px; margin: 0 0 12px; word-break: keep-all; }
.cta-band p { color: var(--text-dim); font-size: 15px; margin: 0 0 26px; word-break: keep-all; }
.cta-band .hero-cta { justify-content: center; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 48px 0; }
  .hero h1 { font-size: 34px; }
  .feat-grid, .steps-row { grid-template-columns: 1fr; }
}

/* ── 다운로드(2단 배치) ── */
.dl-wrap { max-width: 920px; margin: 0 auto; padding: 48px 24px 24px; }
.dl-intro { padding-bottom: 28px; }
.dl-intro h1 { font-size: 38px; letter-spacing: -0.8px; margin: 0 0 10px; }
.dl-intro > p:not(.dl-meta) { color: var(--text-dim); font-size: 16px; }
.dl-meta { color: var(--text-faint); font-size: 13px; margin-top: 16px; }
.dl-meta strong { color: var(--accent); font-weight: 700; }
.dl-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding: 36px 0; border-top: 1px solid var(--border); }
.dl-row:first-child, .dl-intro + .dl-row { border-top: 0; }
.dl-row-label { font-size: 16px; color: var(--text); }
.dl-row-label .n { color: var(--text-faint); font-family: var(--mono); margin-right: 6px; }
.dl-row-label b { color: var(--accent); font-weight: 700; }
.dl-row-label .sub { display: block; color: var(--text-faint); font-size: 13px; margin-top: 6px; line-height: 1.5; }
.dl-cmd { font-family: var(--mono); font-size: 14px; line-height: 2; color: var(--text); overflow-x: auto; white-space: nowrap; }
.dl-cmd .muted { color: var(--text-faint); }
.dl-cmd .hl { color: var(--accent); }
.dl-cmd-note { color: var(--text-faint); font-size: 13px; margin-top: 14px; line-height: 1.6; }
.dl-cmd-note code { font-family: var(--mono); color: var(--accent); background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }
.dl-os { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.dl-os:last-of-type { border-bottom: 0; }
.dl-os .ico { width: 20px; display: inline-flex; align-items: center; justify-content: center; opacity: 0.85; flex: 0 0 auto; color: var(--text); }
.dl-os .name { color: var(--text); font-size: 15px; white-space: nowrap; }
.dl-os .arch { color: var(--text-faint); font-size: 13px; font-family: var(--mono); margin-left: 6px; white-space: nowrap; }
.dl-os .size { color: var(--text-faint); font-size: 12px; white-space: nowrap; }
.dl-os .spacer { margin-left: auto; }
.dl-os a.btn { text-decoration: none; border: 1px solid var(--border-strong); color: var(--text); border-radius: var(--radius); padding: 7px 18px; font-size: 13px; white-space: nowrap; flex: 0 0 auto; transition: all .2s cubic-bezier(.4, 0, .2, 1); }
.dl-os a.btn:hover { background: var(--accent); color: var(--on-solid); border-color: var(--accent); }
.dl-os .btn-soon { border: 1px solid var(--border); color: var(--text-faint); border-radius: var(--radius); padding: 7px 18px; font-size: 13px; white-space: nowrap; flex: 0 0 auto; }
.dl-os.soon { opacity: 0.6; }
.dl-guide { color: var(--text-dim); font-size: 14px; line-height: 1.7; }
.dl-guide p + p { margin-top: 12px; }
.dl-guide b { color: var(--text); }
@media (max-width: 640px) { .dl-row { grid-template-columns: 1fr; gap: 10px; } }

/* ── 문서(3단: 사이드바·본문·목차) ── */
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 40px; max-width: 1180px; margin: 0 auto; padding: 40px 24px 24px; align-items: start; }
.docs-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.docs-side a { color: var(--text-dim); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: 6px; }
.docs-side a:hover { color: var(--text); background: var(--bg-2); }
.docs-side a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; border-left: 4px solid var(--accent); padding-left: 6px; }
.docs-main { min-width: 0; }
.docs-main h1 { font-size: 38px; font-weight: 800; margin: 0 0 16px; padding-bottom: 16px; letter-spacing: -0.6px; border-bottom: 2px solid var(--border); }
.docs-main h2 { font-size: 28px; font-weight: 700; margin: 36px 0 14px; padding-left: 14px; position: relative; }
.docs-main h2::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 2px; background: var(--accent); }
.docs-main h3 { font-size: 21px; font-weight: 700; margin: 24px 0 8px; }
.docs-main p { color: var(--text-dim); font-size: 17px; line-height: 1.8; }
.docs-main li { color: var(--text-dim); font-size: 17.5px; line-height: 1.75; }
.docs-main ul, .docs-main ol { padding-left: 22px; }
.docs-main a { color: var(--accent); }
.docs-main blockquote { border-left: 3px solid var(--border-strong); margin: 14px 0; padding: 4px 0 4px 14px; color: var(--text-faint); }
.docs-main hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.docs-main pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.6; margin: 12px 0; }
.docs-main code { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }
.docs-main pre code { background: transparent; color: var(--text); font-weight: 400; font-size: 13px; padding: 0; }
.docs-main .doc-figure { margin: 22px 0 28px; }
.docs-main .doc-figure img { display: block; width: 100%; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); cursor: zoom-in; }
.docs-main .doc-figure img:focus { outline: 2px solid var(--accent); outline-offset: 3px; }
.docs-main .doc-figure figcaption { margin-top: 8px; color: var(--text-faint); font-size: 13px; line-height: 1.5; }
.docs-toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 4px; }
.docs-toc .toc-title { color: var(--text-faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.docs-toc a { color: var(--text-faint); text-decoration: none; font-size: 13px; line-height: 1.5; }
.docs-toc a:hover { color: var(--text); }
.docs-toc a.lvl3 { padding-left: 12px; }
body.doc-lightbox-open { overflow: hidden; }
.doc-lightbox {
  position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px; padding: 22px; background: rgba(7, 6, 6, 0.88); backdrop-filter: blur(6px);
}
.doc-lightbox[hidden] { display: none; }
.doc-lightbox-close {
  justify-self: end; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--bg-2);
  color: var(--text); padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer;
}
.doc-lightbox-close:hover { border-color: var(--accent); color: var(--accent); }
.doc-lightbox-img {
  align-self: center; justify-self: center; max-width: min(96vw, 1600px); max-height: calc(100vh - 128px);
  width: auto; height: auto; object-fit: contain; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--bg-2); box-shadow: 0 18px 80px rgba(0,0,0,0.5);
}
.doc-lightbox-caption { justify-self: center; max-width: min(96vw, 1100px); color: var(--text-dim); font-size: 13px; text-align: center; }
@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 20px; }
  .docs-side, .docs-toc { position: static; }
  .docs-toc { display: none; }
  .doc-lightbox { padding: 14px; }
  .doc-lightbox-img { max-height: calc(100vh - 112px); }
}
