@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════
   AG RADIX — 진법 변환기 (2108 / agradix)
   DesignKit Console 킷 변형: 다크 터미널 · 모노스페이스 · 신호등 헤더.
   변형 포인트 — neon(시안) 기본(형제 2105=terminal 그린·2109=midnight 블루와
   색으로 구분), 중앙 워크벤치 레이아웃, 진법 카드 그리드 +
   인터랙티브 비트 그리드(Console 킷 원본에 없음).
═══════════════════════════════════════════════════════════ */

:root {
  /* ── 컬러(다크 neon 기본) ── */
  --primary:#22D3EE; --primary-dark:#06B6D4; --accent:#A3E635;
  --grad:linear-gradient(135deg,#22D3EE,#A3E635);
  --bg:#0A0E14; --surface:#121821; --surface-2:#0E141C;
  --border:#1E293B; --border-2:#334155; --border-soft:#161E2A;
  --text:#E2E8F0; --text-strong:#F8FAFC; --text-2:#94A3B8; --text-3:#64748B;
  --ok:#22D3EE; --err:#F87171; --warn:#FBBF24;
  --primary-alpha: color-mix(in srgb, var(--primary) 18%, transparent);
  --primary-glow:  color-mix(in srgb, var(--primary) 30%, transparent);

  /* ── 형태·모션(킷 고유) ── */
  --bd:1px;
  --r-1:5px; --r-2:6px; --r-3:8px; --r-4:10px;
  --sh-1:0 1px 2px rgba(0,0,0,.30);
  --sh-2:0 4px 14px rgba(0,0,0,.38);
  --glow:0 0 0 1px var(--primary-alpha), 0 8px 24px var(--primary-glow);
  --ease:cubic-bezier(.4,0,.2,1);
  --ease-out:cubic-bezier(.16,1,.3,1);
  --t1:130ms; --t2:240ms;
  /* 레거시 인라인(client_info 등) 호환 */
  --bg-card:var(--surface); --text-primary:var(--text-strong);
  --text-secondary:var(--text-2); --text-muted:var(--text-3);
  --accent-primary:var(--primary);
}

/* ── 라이트 모드 ── */
[data-theme="light"] {
  --primary:#0891B2; --primary-dark:#0E7490; --accent:#65A30D;
  --grad:linear-gradient(135deg,#0891B2,#65A30D);
  --bg:#F5F9FB; --surface:#FFFFFF; --surface-2:#EFF6F8;
  --border:#DBE8ED; --border-2:#BFD6DE; --border-soft:#E6F0F3;
  --text:#132229; --text-strong:#08161B; --text-2:#47606B; --text-3:#78929B;
  --ok:#0891B2; --err:#DC2626; --warn:#D97706;
}

*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }

body {
  font-family:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  color:var(--text);
  min-height:100vh;
  display:flex; flex-direction:column; align-items:center;
  padding:0 20px 80px;
  overflow-x:hidden;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 33px, color-mix(in srgb, var(--text-strong) 3%, transparent) 34px),
    radial-gradient(1000px 500px at 82% -12%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 60%),
    var(--bg);
  background-attachment:fixed;
}

/* ─── HEADER ─── */
.site-header {
  position:sticky; top:0; z-index:50;
  width:100vw; margin-bottom:8px;
  border-bottom:var(--bd) solid var(--border);
  background:color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
}
.site-header__inner {
  max-width:920px; margin:0 auto; height:58px; padding:0 20px;
  display:flex; align-items:center; justify-content:space-between;
}
.site-header__logo { display:inline-flex; align-items:center; gap:10px; text-decoration:none; color:var(--text-strong); font-weight:800; }
.logo-badge {
  position:relative; width:34px; height:30px;
  display:inline-flex; align-items:flex-end; justify-content:center; padding-bottom:5px;
  border-radius:var(--r-2); border:var(--bd) solid var(--border-2);
  background:var(--surface-2); color:var(--primary); overflow:hidden;
}
.logo-badge::before {
  content:''; position:absolute; top:6px; left:7px;
  width:6px; height:6px; border-radius:50%;
  background:var(--err); box-shadow:9px 0 0 var(--warn), 18px 0 0 var(--primary);
}
.logo-badge svg { width:15px; height:15px; }
.logo-text { display:inline-flex; flex-direction:column; line-height:1.12; gap:1px; }
.logo-main { font-size:1.02rem; font-weight:800; letter-spacing:-0.02em; color:var(--text-strong); }
.logo-main .accent { color:var(--primary); }
.logo-sub { font-size:0.56rem; font-weight:700; letter-spacing:0.2em; color:var(--text-3); }

.header-actions { display:flex; align-items:center; gap:6px; }
.site-header__nav { display:flex; align-items:center; gap:4px; }
.site-header__nav a {
  font-size:0.8rem; font-weight:500; color:var(--text-2); text-decoration:none;
  padding:7px 11px; border-radius:var(--r-1); border:var(--bd) solid transparent;
  transition:all var(--t1) var(--ease);
}
.site-header__nav a:hover { color:var(--primary); border-color:var(--border-2); background:var(--surface-2); }
.theme-toggle-btn {
  width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center;
  background:var(--surface-2); border:var(--bd) solid var(--border-2); border-radius:var(--r-1);
  color:var(--text-2); cursor:pointer; transition:all var(--t1) var(--ease);
}
.theme-toggle-btn:hover { color:var(--primary); border-color:var(--primary); }
.theme-toggle-btn svg { width:17px; height:17px; }
.lang-select {
  font-family:inherit; font-size:0.78rem; font-weight:600; color:var(--text-2);
  background:var(--surface-2); border:var(--bd) solid var(--border-2); border-radius:var(--r-1);
  padding:7px 26px 7px 11px; cursor:pointer; outline:none;
  appearance:none; -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 10px center;
  transition:border-color var(--t1) var(--ease), color var(--t1) var(--ease);
}
.lang-select:hover { border-color:var(--primary); color:var(--text-strong); }
@media (max-width:420px){ .lang-select { display:none; } }
.theme-toggle-btn .ic-dark { display:none; }
[data-theme="light"] .theme-toggle-btn .ic-light { display:none; }
[data-theme="light"] .theme-toggle-btn .ic-dark { display:inline-flex; }
@media (max-width:560px){ .site-header__nav { display:none; } }

/* ─── HERO ─── */
.hero { width:100%; max-width:920px; margin:34px auto 6px; text-align:left; }
.hero-icon {
  display:inline-flex; align-items:center; justify-content:center;
  width:52px; height:52px; margin-bottom:18px;
  background:var(--surface-2); border:var(--bd) solid var(--border-2);
  color:var(--primary); border-radius:var(--r-3);
  box-shadow:var(--sh-2), inset 0 0 0 1px color-mix(in srgb, var(--primary) 16%, transparent);
}
.hero-icon svg { width:26px; height:26px; }
.hero h1 {
  font-size:clamp(1.8rem, 5vw, 2.8rem); font-weight:800; color:var(--text-strong);
  letter-spacing:-0.03em; line-height:1.14; margin-bottom:14px;
}
.hero h1 .grad { background:var(--grad); -webkit-background-clip:text; background-clip:text; color:transparent; }
.hero h1 .grad::before { content:'> '; -webkit-text-fill-color:var(--primary); color:var(--primary); }
.hero p { font-size:0.94rem; color:var(--text-2); line-height:1.7; max-width:600px; word-break:keep-all; }

/* ─── SECTION LABEL (`// 주석`) ─── */
.section-label { width:100%; max-width:920px; margin:34px auto 14px; }
.section-label span { font-size:0.8rem; font-weight:700; color:var(--text-3); }
.section-label span::before { content:'// '; color:var(--primary); }

/* ─── WORKBENCH (메인 도구) ─── */
.workbench { width:100%; max-width:920px; margin:0 auto; }

.panel {
  background:var(--surface); border:var(--bd) solid var(--border); border-radius:var(--r-4);
  box-shadow:var(--sh-1); overflow:hidden; margin-bottom:18px;
}
.panel-bar {
  display:flex; align-items:center; gap:8px;
  padding:11px 18px; background:var(--surface-2); border-bottom:var(--bd) solid var(--border);
  font-size:0.7rem; font-weight:700; letter-spacing:0.1em; text-transform:uppercase; color:var(--text-3);
}
.panel-bar::before {
  content:''; width:8px; height:8px; border-radius:50%;
  background:var(--err); box-shadow:13px 0 0 var(--warn), 26px 0 0 var(--primary);
  margin-right:26px;
}
.panel-body { padding:20px 18px; }

/* 입력부 */
.input-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:11px; gap:10px; flex-wrap:wrap; }
.input-head label { font-size:0.82rem; font-weight:700; color:var(--text); }
.input-head label::before { content:'$ '; color:var(--text-3); font-weight:500; }
.base-picker { display:inline-flex; align-items:center; gap:8px; }
.base-picker .bp-txt { font-size:0.74rem; color:var(--text-3); }
.sel-wrap { position:relative; }
.sel-wrap::after { content:'▾'; position:absolute; right:10px; top:50%; transform:translateY(-50%); color:var(--text-3); font-size:0.72rem; pointer-events:none; }
select.sel {
  appearance:none; -webkit-appearance:none;
  font-family:inherit; font-size:0.82rem; font-weight:700; color:var(--text-strong);
  background:var(--surface-2); border:var(--bd) solid var(--border-2); border-radius:var(--r-1);
  padding:7px 26px 7px 11px; cursor:pointer; outline:none; transition:all var(--t1) var(--ease);
}
select.sel:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-alpha); }

.big-input {
  width:100%; padding:16px 18px;
  font-family:inherit; font-size:1.4rem; font-weight:700; letter-spacing:0.01em;
  background:var(--surface-2); border:var(--bd) solid var(--border-2); border-radius:var(--r-2);
  color:var(--text-strong); outline:none; word-break:break-all;
  font-variant-numeric:tabular-nums; transition:all var(--t1) var(--ease);
}
.big-input:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-alpha); }
.big-input::placeholder { color:var(--text-3); font-weight:400; }
.big-input.err { border-color:var(--err); box-shadow:0 0 0 3px color-mix(in srgb, var(--err) 20%, transparent); }

.input-msg { margin-top:9px; font-size:0.76rem; min-height:1.1em; color:var(--text-3); }
.input-msg.err { color:var(--err); }
.input-msg b { color:var(--text-2); font-weight:700; }

.quick-row { display:flex; gap:7px; flex-wrap:wrap; margin-top:12px; }
.quick-chip {
  font-family:inherit; font-size:0.72rem; font-weight:600; color:var(--text-2);
  background:var(--surface-2); border:var(--bd) solid var(--border-2); border-radius:var(--r-1);
  padding:6px 11px; cursor:pointer; transition:all var(--t1) var(--ease);
}
.quick-chip:hover { color:var(--primary); border-color:var(--primary); }

/* 진법 결과 그리드 */
.base-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
@media (max-width:600px){ .base-grid { grid-template-columns:1fr; } }
.base-cell {
  background:var(--surface-2); border:var(--bd) solid var(--border); border-radius:var(--r-3);
  padding:13px 14px; transition:border-color var(--t1) var(--ease);
}
.base-cell:hover { border-color:var(--border-2); }
.base-cell.custom { border-color:var(--primary-alpha); background:color-mix(in srgb, var(--primary) 6%, var(--surface-2)); }
.base-cell-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.base-tag { font-size:0.66rem; font-weight:700; letter-spacing:0.06em; color:var(--primary); }
.base-tag .bt-sub { color:var(--text-3); font-weight:500; margin-left:5px; }
.copy-btn {
  display:inline-flex; align-items:center; gap:4px;
  font-family:inherit; font-size:0.66rem; font-weight:700; color:var(--text-3);
  background:transparent; border:var(--bd) solid var(--border-2); border-radius:var(--r-1);
  padding:4px 8px; cursor:pointer; transition:all var(--t1) var(--ease);
}
.copy-btn:hover { color:var(--primary); border-color:var(--primary); }
.copy-btn.done { color:var(--ok); border-color:var(--ok); }
.copy-btn svg { width:12px; height:12px; }
.base-val {
  font-size:1.02rem; font-weight:700; color:var(--text-strong);
  word-break:break-all; line-height:1.4; font-variant-numeric:tabular-nums;
  min-height:1.4em;
}
.base-val.empty { color:var(--text-3); font-weight:400; }
.custom-picker { display:flex; align-items:center; gap:7px; }

/* 비트 그리드 */
.bit-tabs { display:flex; gap:6px; margin-bottom:14px; flex-wrap:wrap; }
.bit-tab {
  font-family:inherit; font-size:0.76rem; font-weight:700; color:var(--text-3);
  background:var(--surface-2); border:var(--bd) solid var(--border-2); border-radius:var(--r-1);
  padding:8px 14px; cursor:pointer; transition:all var(--t1) var(--ease);
}
.bit-tab:hover { color:var(--text-2); }
.bit-tab.active { background:color-mix(in srgb, var(--primary) 14%, var(--surface-2)); border-color:var(--primary); color:var(--primary); }

.bit-view { display:flex; flex-direction:column; gap:12px; }
.bit-line { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.bit-line-lbl { font-size:0.6rem; font-weight:700; color:var(--text-3); width:34px; letter-spacing:0.05em; }
.bit-nibbles { display:flex; gap:8px; flex-wrap:wrap; }
.bit-nibble { display:flex; gap:3px; }
.bit {
  width:26px; height:32px; display:inline-flex; align-items:center; justify-content:center;
  font-size:0.9rem; font-weight:700; font-variant-numeric:tabular-nums;
  background:var(--surface-2); border:var(--bd) solid var(--border-2); border-radius:var(--r-1);
  color:var(--text-3); cursor:pointer; user-select:none; transition:all var(--t1) var(--ease);
}
.bit:hover { border-color:var(--primary); }
.bit.on { background:color-mix(in srgb, var(--primary) 20%, var(--surface-2)); border-color:var(--primary); color:var(--primary); }
.bit.overflow { opacity:.35; cursor:not-allowed; }
.bit-index { font-size:0.54rem; color:var(--text-3); text-align:center; margin-top:2px; }
.bit-hint { font-size:0.72rem; color:var(--text-3); margin-top:4px; }
.bit-hint b { color:var(--text-2); font-weight:700; }
@media (max-width:600px){ .bit { width:22px; height:28px; font-size:0.82rem; } }
@media (max-width:400px){ .bit { width:19px; height:26px; } }

/* 부가 정보 */
.stat-row { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
@media (max-width:600px){ .stat-row { grid-template-columns:1fr 1fr; } }
.stat {
  background:var(--surface-2); border:var(--bd) solid var(--border); border-radius:var(--r-2);
  padding:12px 13px;
}
.stat-k { font-size:0.64rem; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-3); margin-bottom:5px; }
.stat-v { font-size:1.04rem; font-weight:800; color:var(--text-strong); font-variant-numeric:tabular-nums; word-break:break-all; }
.stat-v .u { font-size:0.72rem; font-weight:600; color:var(--text-3); margin-left:3px; }

/* ─── 안내 노트 ─── */
.note {
  font-size:0.78rem; color:var(--text-3); line-height:1.7;
  background:var(--surface); border:var(--bd) solid var(--border);
  border-left:3px solid var(--primary-alpha); border-radius:var(--r-2);
  padding:14px 16px; margin-bottom:16px; word-break:keep-all;
}
.note::before { content:'// '; color:var(--primary); font-weight:700; }
.note b { color:var(--text-2); font-weight:700; }

/* ─── FAQ ─── */
.faq { width:100%; max-width:920px; margin:12px auto 0; }
.faq-item { border-bottom:var(--bd) solid var(--border); padding:16px 2px; }
.faq-q { font-size:0.92rem; font-weight:700; color:var(--text-strong); margin-bottom:7px; }
.faq-q::before { content:'Q '; color:var(--primary); }
.faq-a { font-size:0.84rem; color:var(--text-2); line-height:1.7; word-break:keep-all; }

/* ─── TRUST ─── */
.trust-bar {
  width:100%; max-width:920px; margin:34px auto 0; padding-top:24px;
  border-top:var(--bd) solid var(--border);
  display:flex; flex-wrap:wrap; gap:14px 30px;
}
.trust-item { display:inline-flex; align-items:center; gap:8px; font-size:0.8rem; font-weight:500; color:var(--text-3); }
.trust-item svg { width:15px; height:15px; color:var(--primary); }

/* ─── 보조 페이지(about/contact) ─── */
.title-bar {
  width:100%; max-width:640px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between; padding:22px 0 4px;
}
.title-bar__home {
  display:inline-flex; align-items:center; gap:5px; text-decoration:none; color:var(--text-2);
  font-size:0.82rem; font-weight:500; padding:6px 11px;
  border:var(--bd) solid var(--border); border-radius:var(--r-1); background:var(--surface-2);
  transition:all var(--t1) var(--ease);
}
.title-bar__home:hover { color:var(--primary); border-color:var(--primary); }
.title-bar__cat {
  font-size:0.62rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:var(--primary);
  background:var(--surface-2); border:var(--bd) solid var(--primary-alpha); padding:5px 11px; border-radius:var(--r-1);
}
.title-bar__cat::before { content:'~/'; color:var(--text-3); }
.page-container { width:100%; max-width:640px; margin:0 auto; display:flex; flex-direction:column; }
.page-header { text-align:left; margin:16px 0 20px; }
.page-title { font-size:1.5rem; font-weight:800; color:var(--text-strong); letter-spacing:-0.02em; margin-bottom:7px; }
.page-sub { font-size:0.86rem; color:var(--text-2); }
.page-sub::before { content:'# '; color:var(--text-3); }
.contact-field { margin-bottom:16px; }
.contact-label { display:block; font-size:0.82rem; font-weight:700; color:var(--text); margin-bottom:8px; }
.contact-label::before { content:'$ '; color:var(--text-3); font-weight:500; }
.contact-input, .contact-textarea {
  width:100%; padding:13px 15px; font-family:inherit; font-size:0.9rem;
  background:var(--surface-2); border:var(--bd) solid var(--border-2); border-radius:var(--r-2);
  color:var(--text-strong); outline:none; transition:all var(--t1) var(--ease);
}
.contact-input:focus, .contact-textarea:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-alpha); }
.contact-textarea { resize:vertical; min-height:120px; line-height:1.6; }
.start-button {
  width:100%; padding:14px; font-family:inherit; font-size:0.94rem; font-weight:800;
  color:#04181c; background:var(--grad); border:none; border-radius:var(--r-2); cursor:pointer;
  box-shadow:0 6px 20px var(--primary-glow); margin-top:4px; transition:all var(--t1) var(--ease);
}
.start-button::before { content:'$ '; opacity:.6; }
.start-button:hover { transform:translateY(-2px); box-shadow:0 10px 28px var(--primary-glow); }

/* ─── AD (룰 4-1: 래퍼 border-radius/overflow 금지) ─── */
.ad-grid { display:grid; grid-template-columns:repeat(2, 320px); gap:12px; justify-content:center; margin-top:36px; }
.ad-cell { width:320px; min-height:50px; }
@media (max-width:720px){ .ad-grid { grid-template-columns:320px; } }

/* ─── FOOTER ─── */
.site-footer {
  width:100%; max-width:920px; margin:36px auto 0; padding:22px 4px;
  border-top:var(--bd) solid var(--border); text-align:left;
}
.site-footer a { color:var(--text-3); font-size:0.8rem; text-decoration:none; transition:color var(--t1) var(--ease); }
.site-footer a:hover { color:var(--primary); }
.footer-divider { color:var(--border-2); margin:0 10px; }
.sr-title { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* ─── ANIMATIONS ─── */
.animate-fade-in { animation:fadeIn .5s var(--ease-out) both; }
.animate-slide-up { animation:slideUp .5s var(--ease-out) both; }
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
@keyframes slideUp { from{opacity:0; transform:translateY(16px);} to{opacity:1; transform:translateY(0);} }

@media (max-width:480px){
  body { padding:0 14px 64px; }
  .hero { margin-top:26px; }
  .panel-body { padding:16px 14px; }
}
