/* style.css — UA GEN (2204 / uagen)
   kit-console 변형 · linear.app 무드(다크 slate + violet 액센트). 개발자툴 정체성(모노·코드블록) 유지. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.mono, code, pre, .ua-out, .bot-ua { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ── 헤더 ── */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { display: flex; align-items: center; gap: 14px; height: 60px; max-width: 960px; margin: 0 auto; padding: 0 20px; }
.site-header__logo { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.logo-badge {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #a78bfa); color: #fff;
}
.logo-badge svg { width: 18px; height: 18px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-main { font-size: 15px; letter-spacing: -.01em; }
.logo-main .accent { color: var(--accent); }
.logo-sub { font-size: 9.5px; letter-spacing: .22em; color: var(--text-3); font-weight: 600; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.site-header__nav { display: flex; gap: 4px; }
.site-header__nav a { padding: 7px 11px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; font-weight: 500; transition: .15s; }
.site-header__nav a:hover { color: var(--text); background: var(--surface-2); }
.lang-select {
  appearance: none; background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; cursor: pointer;
}
.theme-toggle-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); cursor: pointer; display: grid; place-items: center;
}
.theme-toggle-btn svg { width: 16px; height: 16px; }
.theme-toggle-btn .ic-dark { display: none; }
:root[data-theme="light"] .theme-toggle-btn .ic-light { display: none; }
:root[data-theme="light"] .theme-toggle-btn .ic-dark { display: inline-flex; }

/* ── masthead ── */
.masthead { padding: 40px 0 22px; }
.masthead .eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 5px 11px; border-radius: 999px; margin-bottom: 16px;
}
.masthead .eyebrow svg { width: 13px; height: 13px; }
.masthead h1 { font-size: 30px; line-height: 1.15; }
.masthead h1 .g, .masthead h1.g { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.masthead p { margin: 12px 0 0; color: var(--text-2); font-size: 15.5px; max-width: 60ch; }

/* ── 스튜디오(워크벤치) — 구성 선택 위 / 생성 결과 아래 세로 스택 ── */
.studio { display: flex; flex-direction: column; gap: 18px; }
/* 넓은 폭을 활용해 옵션을 2열 그리드로 */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.opt-grid .field-row { margin-bottom: 0; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 8px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-head .ci { width: 15px; height: 15px; color: var(--accent); }
.card-head h2 { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); }
.card-body { padding: 18px; }

/* 디바이스 세그 */
.dev-seg { display: flex; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.dev-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
  padding: 8px 6px; border-radius: 7px; font-size: 13.5px; font-weight: 600; font-family: inherit; transition: .15s;
}
.dev-btn svg { width: 15px; height: 15px; }
.dev-btn.active { background: var(--bg-2); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.dev-btn.active { color: var(--accent); }

/* 필드/셀렉트 */
.field-row { margin-bottom: 15px; }
.field-row:last-child { margin-bottom: 0; }
.field-label { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 7px; }
.sel {
  width: 100%; appearance: none; cursor: pointer;
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7385' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border); border-radius: 9px; color: var(--text);
  padding: 10px 34px 10px 12px; font-size: 14px; font-family: inherit; transition: .15s;
}
.sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 결과 카드 */
.result-card .card-body { padding: 0; }
.ua-out {
  display: block; margin: 0; padding: 20px; background: var(--code-bg); color: var(--code-text);
  font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; min-height: 92px;
  border-bottom: 1px solid var(--border);
}
.ua-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit;
  border-radius: 9px; padding: 9px 14px; font-size: 13.5px; font-weight: 600; transition: .15s; border: 1px solid transparent;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-2); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-family: inherit;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 500; transition: .15s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip svg { width: 14px; height: 14px; }

/* 파싱 배지 */
.parse-badges { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 18px; }
.pb { display: inline-flex; align-items: stretch; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: 12.5px; }
.pb-k { padding: 5px 9px; background: var(--surface-2); color: var(--text-3); font-weight: 600; }
.pb-v { padding: 5px 10px; color: var(--text); font-weight: 600; }

/* 섹션 */
.section { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.section-head h2 { font-size: 18px; }
.section-head p { margin: 0; color: var(--text-3); font-size: 13.5px; }

/* 프리셋 */
.preset-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.preset-chip { font-weight: 600; color: var(--text); }

/* 대량 생성 */
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.bulk-count { width: 80px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; color: var(--text); padding: 9px 11px; font-size: 14px; font-family: 'JetBrains Mono', monospace; }
.bulk-count:focus { outline: none; border-color: var(--accent); }
.bulk-stat { color: var(--text-3); font-size: 13px; margin-left: auto; }
.bulk-out {
  width: 100%; min-height: 180px; resize: vertical; background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.7; white-space: pre; overflow: auto;
}
.bulk-out:focus { outline: none; border-color: var(--accent); }

/* 봇 리스트 */
.bot-list { display: grid; gap: 8px; }
.bot-row {
  display: grid; grid-template-columns: 190px 78px 1fr; align-items: center; gap: 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 12px 15px;
  cursor: pointer; font-family: inherit; transition: .15s; width: 100%;
}
.bot-row:hover { border-color: var(--accent); background: var(--surface-2); }
.bot-name { font-weight: 700; font-size: 14px; color: var(--text); }
.bot-cat { justify-self: start; font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.cat-search { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 15%, transparent); }
.cat-social { color: #f0a; background: rgba(255, 0, 170, .12); }
.cat-ai { color: var(--accent); background: var(--accent-soft); }
.cat-seo { color: var(--warn); background: rgba(251, 191, 36, .12); }
.cat-tool { color: var(--text-2); background: var(--surface-2); }
.bot-ua { color: var(--text-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 광고 (§4-2) */
.ad-grid { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 672px; margin: 40px auto 8px; }
.ad-grid[data-ad-layout="mixed"] { max-width: 760px; }
.ad-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; }
.ad-cell { min-height: 50px; }

/* 푸터 */
.site-footer {
  margin-top: 50px; border-top: 1px solid var(--border); padding: 26px 20px; text-align: center;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px;
  color: var(--text-3); font-size: 13px;
}
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--accent); }
.footer-copy { color: var(--text-3); }
.footer-proj { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-3); opacity: .6; }

/* 콘텐츠(문서) 페이지 */
.doc { max-width: 760px; margin: 0 auto; padding: 30px 0 10px; }
.doc-title { font-size: 26px; margin-bottom: 8px; }
.doc-sub { color: var(--text-2); margin: 0 0 22px; }
.doc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px; }
.doc-card p { margin: 0 0 14px; color: var(--text); }
.content-h2 { font-size: 17px; margin: 26px 0 10px; color: var(--text); }
.doc-list { margin: 0 0 14px; padding-left: 20px; color: var(--text-2); }
.doc-list li { margin: 4px 0; }
.doc-list li code, .doc-card p code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 12.5px; color: var(--code-accent); }
.doc-note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; border-radius: 0 8px 8px 0; color: var(--text-2); margin: 0 0 14px; }
.title-bar { max-width: 760px; margin: 0 auto; padding: 22px 0 0; font-size: 13px; color: var(--text-3); display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.title-bar a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.title-bar a:hover { color: var(--accent); }
.title-bar svg { width: 15px; height: 15px; }
.title-bar .sep { color: var(--text-3); opacity: .5; }
.title-bar .cur { color: var(--text); font-weight: 600; }

/* 카드 그리드(허브/데이터사전) */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gc {
  display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px; transition: .15s;
}
.gc:hover { border-color: var(--accent); transform: translateY(-2px); }
.gc-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.gc-title .badge { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 2px 6px; }
.gc-desc { color: var(--text-3); font-size: 13px; }
.gc-more { margin-top: auto; color: var(--accent); font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.gc-more svg { width: 13px; height: 13px; }

/* 데이터 테이블 */
.spec-table { width: 100%; border-collapse: collapse; margin: 4px 0 14px; font-size: 13.5px; }
.spec-table th, .spec-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table th { color: var(--text-3); font-weight: 600; width: 32%; }
.spec-table td code, .spec-table td .m { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--code-accent); word-break: break-all; }
.ua-sample { display: block; background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 14px 16px; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.7; word-break: break-all; margin: 6px 0 14px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(12px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 60; box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* about/contact 리스트 */
.faq-q { font-weight: 700; margin: 18px 0 6px; color: var(--text); }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.feature-list li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; }
.feature-list .fi { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }

.animate-fade-in { animation: fadeIn .4s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 반응형 */
@media (max-width: 560px) {
  .opt-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .masthead h1 { font-size: 25px; }
  .masthead { padding: 30px 0 18px; }
  .bot-row { grid-template-columns: 1fr auto; grid-template-areas: "name cat" "ua ua"; gap: 6px 10px; }
  .bot-name { grid-area: name; } .bot-cat { grid-area: cat; justify-self: end; } .bot-ua { grid-area: ua; white-space: normal; word-break: break-all; }
  .site-header__nav { display: none; }
}
[dir="rtl"] .bulk-stat { margin-left: 0; margin-right: auto; }
[dir="rtl"] .header-actions { margin-left: 0; margin-right: auto; }
