/* ===== 글꼴 (셀프 호스팅, OFL) — Pretendard는 /fonts/pretendard/pretendard.css ===== */
@font-face {
  font-family: "Geist";
  src: url("/fonts/geist/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ===== 디자인 토큰 ===== */
:root {
  --bg: #071316;
  --surface: #0F292E;
  --line: #1C3A40;
  --text: #E8EEF0;
  --text-sub: #94A3AB;
  --accent: #34D399;
  /* 예약: 후반 보안 서비스용 */
  --danger: #EF4444;
  --warning: #F59E0B;

  --font-en: "Geist", "Pretendard", system-ui, sans-serif;
  --font-ko: "Pretendard", "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", "Pretendard", ui-monospace, Consolas, monospace;

  --measure: 680px;
  --pad-x: 32px;
  --radius: 6px;
  --dur: 0.2s;
  color-scheme: dark;
}

/* ===== 기본 ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html.modal-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ko);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
svg { display: block; }
.mono { font-family: var(--font-mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 키보드 포커스 표시 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
.sheet:focus { outline: none; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 8px 14px; background: var(--accent); color: var(--bg);
  border-radius: var(--radius); font-size: 14px; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad-x); }

/* ===== 버튼 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 22px;
  font-size: 14px; line-height: 1.2; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: none; color: var(--text); cursor: pointer;
}
.btn:hover { border-color: var(--text-sub); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.btn.primary:hover { background: var(--text); border-color: var(--text); }
.btn:disabled { opacity: .5; cursor: default; }

.icon-btn {
  flex: none; display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: none; cursor: pointer;
}
.icon-btn:hover { border-color: var(--text-sub); }
.icon-btn svg { width: 18px; height: 18px; stroke: var(--text); fill: none; stroke-width: 1.5; stroke-linecap: round; }

/* ===== 머리글 ===== */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 56px; gap: 16px; }
/* 로고: assets/logo/lockup/liberaum-lockup-on-dark.svg, 높이 28px (README: 최소 너비 120px) */
.logo { display: block; flex: none; line-height: 0; }
.logo img { display: block; width: auto; height: 28px; }
.nav { display: flex; gap: 24px; font-size: 14px; }
.nav a { color: var(--text-sub); text-decoration: none; padding: 6px 0; }
.nav a:hover { color: var(--text); }

/* ===== 첫 화면 ===== */
.hero { padding: 120px var(--pad-x) 112px; text-align: center; }
.tag { margin-bottom: 16px; font-size: 12px; letter-spacing: .2em; color: var(--accent); }
.hero h1 {
  font-family: var(--font-en); font-weight: 500;
  font-size: clamp(40px, 7vw, 80px); line-height: 1.1; letter-spacing: -.02em;
}
.lead { margin: 24px 0 36px; color: var(--text-sub); font-size: 18px; }
.btns { display: flex; gap: 12px; justify-content: center; }

/* ===== 섹션 공통 ===== */
.section { border-top: 1px solid var(--line); padding: 96px 0; }
.section h2 {
  font-family: var(--font-en); font-weight: 500;
  font-size: clamp(28px, 4vw, 40px); line-height: 1.2; letter-spacing: -.015em;
  margin-bottom: 40px;
}
.section h2:has(+ .section-sub) { margin-bottom: 8px; }
.section-sub { color: var(--text-sub); margin-bottom: 40px; }

/* 1px 격자 */
.cells {
  display: grid; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
}
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cell { background: var(--surface); padding: 28px; }
.cell h3 { font-size: 18px; font-weight: 600; line-height: 1.4; }
.cell p { color: var(--text-sub); margin-top: 6px; }

/* Tools: 서비스 칸 */
.service-grid > li { display: flex; }
.service-cell {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  width: 100%; padding: 24px; text-align: left;
  background: var(--surface); border: 0; border-radius: 0; cursor: pointer;
}
.service-cell:hover { background: var(--line); }
.service-cell:focus-visible { outline-offset: -2px; }
.service-cell svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.service-cell .open-mark { position: absolute; top: 24px; right: 24px; width: 16px; height: 16px; stroke: var(--text-sub); }
.service-cell .name { margin-top: 14px; font-family: var(--font-en); font-size: 15px; font-weight: 500; line-height: 1.4; }
.service-cell .status { margin-top: 4px; font-size: 12px; color: var(--text-sub); }
.cell-error { grid-column: 1 / -1; background: var(--surface); padding: 24px; color: var(--text-sub); }

/* Roadmap */
.roadmap .step { margin: 0 0 8px; font-size: 13px; letter-spacing: .08em; color: var(--text-sub); }
.roadmap .is-now .step { color: var(--accent); }

/* Privacy is a Sanctuary */
.pledges { max-width: var(--measure); border-top: 1px solid var(--line); }
.pledges li {
  display: flex; gap: 20px; align-items: baseline;
  padding: 20px 0; border-bottom: 1px solid var(--line); font-size: 18px;
}
.pledges .idx { flex: none; font-size: 12px; color: var(--accent); letter-spacing: .1em; }
.more-link { margin-top: 28px; font-size: 15px; }
.more-link a, .footer-info a { color: var(--text); text-underline-offset: 4px; text-decoration-color: var(--text-sub); }
.more-link a:hover, .footer-info a:hover { text-decoration-color: var(--accent); }

/* ===== 하단 ===== */
.site-footer { border-top: 1px solid var(--line); padding: 64px 0 120px; }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-motto { margin-top: 16px; font-family: var(--font-en); font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.footer-info { display: grid; gap: 16px; font-size: 15px; }
.footer-info dt { font-size: 12px; color: var(--text-sub); letter-spacing: .08em; }
.footer-info dd { margin-top: 2px; }
.footer-bottom { margin-top: 48px; font-size: 12px; color: var(--text-sub); }

/* ===== 질문 버튼 ===== */
.chat-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 30;
  min-height: 44px; padding: 10px 20px;
  font-size: 14px; font-weight: 500;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.chat-fab:hover { border-color: var(--accent); }

/* ===== 패널 (드로어 / 바텀시트) ===== */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgb(7 19 22 / .72);
  opacity: 0; transition: opacity var(--dur) ease;
}
.overlay.is-open { opacity: 1; }

.sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(480px, 100%);
  display: flex; flex-direction: column;
  background: var(--bg); border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform var(--dur) ease;
}
.sheet.is-open { transform: none; }
.sheet[hidden] { display: none; }

.sheet-head {
  flex: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
}
.sheet-title { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.sheet-icon svg { width: 24px; height: 24px; margin-top: 4px; stroke: var(--accent); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sheet-head h2 { font-family: var(--font-en); font-size: 22px; font-weight: 500; line-height: 1.4; }
.sheet-head h2 .name-note { margin-left: 8px; font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--text-sub); }
.sheet-sub { color: var(--text-sub); font-size: 15px; }

.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 24px 32px; }
.sheet-section { padding-top: 28px; }
.sheet-section h3 {
  margin-bottom: 10px; font-family: var(--font-mono);
  font-size: 12px; font-weight: 500; letter-spacing: .08em; color: var(--accent);
}
.sheet-section p { color: var(--text); }
.feature-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.feature-list li { background: var(--surface); padding: 14px 16px; }
.feature-list strong { display: block; font-weight: 600; font-size: 16px; }
.feature-list span { color: var(--text-sub); font-size: 15px; }
.usage-list { counter-reset: step; }
.usage-list li { display: flex; gap: 14px; padding: 6px 0; }
.usage-list li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  flex: none; padding-top: 3px; font-family: var(--font-mono); font-size: 12px; color: var(--text-sub);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th, .data-table td { padding: 12px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.data-table tr:first-child th, .data-table tr:first-child td { border-top: 1px solid var(--line); }
.data-table th { width: 38%; padding-right: 16px; font-weight: 500; color: var(--text-sub); }
.data-table td.tbd { color: var(--text-sub); font-family: var(--font-mono); font-size: 13px; }
.status-line { display: flex; align-items: center; gap: 10px; }
.status-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px;
  font-family: var(--font-mono); font-size: 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.status-note { margin-top: 10px; color: var(--text-sub) !important; font-size: 15px; }

details.more { margin-top: 12px; }
details.more summary { cursor: pointer; width: fit-content; font-size: 14px; color: var(--text-sub); }
details.more summary:hover { color: var(--text); }
details.more p { margin-top: 8px; color: var(--text-sub); font-size: 15px; }

/* 질문 패널 */
.chat-body { display: flex; flex-direction: column; gap: 20px; padding-top: 20px; }
.chat-log { display: flex; flex-direction: column; gap: 12px; }
.chat-log:empty { display: none; }
.msg { max-width: 88%; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px; line-height: 1.65; }
.msg.user { align-self: flex-end; background: var(--surface); }
.msg.bot { align-self: flex-start; }
.msg .who { display: block; margin-bottom: 2px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--text-sub); }
.chat-examples { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.chat-examples .label { font-family: var(--font-mono); font-size: 12px; color: var(--text-sub); letter-spacing: .08em; }
.chip {
  min-height: 40px; padding: 8px 14px; text-align: left;
  font-size: 15px; background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.chip:hover { border-color: var(--text-sub); }
.chat-form { flex: none; padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.chat-notice { margin-bottom: 10px; font-size: 13px; color: var(--text-sub); }
.chat-row { display: flex; gap: 8px; }
.chat-row input {
  flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; font-size: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.chat-row input::placeholder { color: var(--text-sub); }
.chat-row input:focus-visible { outline-offset: 0; border-color: var(--accent); }

/* ===== 개인정보 페이지 ===== */
.doc-page { padding: 88px 0 96px; }
.doc-page .wrap > * { max-width: 860px; }
.doc-title { font-size: clamp(30px, 5vw, 44px); font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.doc-note { margin-top: 16px; max-width: var(--measure); color: var(--text-sub); }
.doc-section { margin-top: 64px; }
.doc-section h2 { margin-bottom: 20px; font-family: var(--font-en); font-size: 24px; font-weight: 500; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); }
.summary-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; }
.summary-table th, .summary-table td { padding: 14px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.summary-table tbody tr:last-child > * { border-bottom: 0; }
.summary-table thead th { background: var(--surface); font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .06em; color: var(--text-sub); }
.summary-table tbody th { width: 22%; font-weight: 600; }
.summary-table td + td, .summary-table th + td { border-left: 1px solid var(--line); }
.summary-table td.tbd { color: var(--text-sub); font-family: var(--font-mono); font-size: 13px; }
.doc-small { margin-top: 12px; font-size: 14px; color: var(--text-sub); }
.legal-list { max-width: var(--measure); counter-reset: art; border-top: 1px solid var(--line); }
.legal-list li { padding: 20px 0; border-bottom: 1px solid var(--line); }
.legal-list h3 { display: flex; gap: 14px; font-size: 17px; font-weight: 600; }
.legal-list h3::before { counter-increment: art; content: "제" counter(art) "조"; flex: none; padding-top: 2px; font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--accent); }
.legal-list .placeholder { margin-top: 6px; color: var(--text-sub); font-size: 15px; }

/* ===== 모바일 ===== */
@media (max-width: 640px) {
  :root { --pad-x: 20px; }
  .nav { gap: 16px; font-size: 13px; }
  .hero { padding: 88px var(--pad-x) 80px; }
  .section { padding: 64px 0; }
  .section h2 { margin-bottom: 28px; }
  .section-sub { margin-bottom: 28px; }
  .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell { padding: 22px 20px; }
  .service-cell { padding: 20px; min-height: 132px; }
  .service-cell .open-mark { top: 20px; right: 20px; }
  .pledges li { font-size: 17px; gap: 16px; }
  .chat-fab { right: 16px; bottom: 16px; }

  /* 바텀시트 */
  .sheet {
    top: auto; left: 0; width: 100%;
    max-height: 88vh; max-height: 88dvh;
    border-left: 0; border-top: 1px solid var(--line);
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
  }
  .sheet-head { padding: 16px 20px; }
  .sheet-body { padding: 4px 20px 28px; }
  .chat-form { padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); }
  #chat-panel { height: 88vh; height: 88dvh; }
}
@media (max-width: 360px) {
  .header-inner { flex-wrap: wrap; justify-content: center; padding-block: 10px; }
}

/* ===== 움직임 줄이기 ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
