/* Liquidation Terminal by StellarMom - documentation
   Design tokens are copied from the landing site so the two read as one product. */

:root {
  color-scheme: dark;

  --bg: #07090d;
  --bg-alt: #090c12;

  --text: #f3f5fa;
  --muted: rgb(226 232 255 / 0.62);
  --faint: rgb(226 232 255 / 0.4);

  --stroke: rgb(255 255 255 / 0.13);
  --stroke-soft: rgb(255 255 255 / 0.07);
  --highlight: rgb(255 255 255 / 0.24);
  --fill: rgb(255 255 255 / 0.06);
  --fill-hover: rgb(255 255 255 / 0.12);
  --sunken: rgb(0 0 0 / 0.28);

  --accent: rgb(138 180 255);
  --accent-dim: rgb(138 180 255 / 0.55);
  --gold: #fbbf24;
  --up: #34d399;
  --down: #fb7185;
  --mint: #97fce4;

  --glass: linear-gradient(150deg, rgb(255 255 255 / 0.1), rgb(255 255 255 / 0.03) 42%, rgb(255 255 255 / 0.05));

  --radius: 16px;
  --radius-sm: 11px;

  --font: 'Sora', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', 'Consolas', monospace;

  --head-h: 58px;
  --side-w: 262px;
  --toc-w: 208px;
  --gutter: 20px;
}

/*
 * CJK 줄바꿈.
 * 한국어와 중국어는 기본 규칙으로 두면 낱말 한가운데서 끊긴다. keep-all 로 막되,
 * 일본어는 문절 단위로 끊는 것이 정상이라 제외한다(keep-all 을 걸면 긴 줄이 넘친다).
 * 세리프 이탤릭은 라틴 문자용이라 CJK 에서는 해제한다 — 가짜 기울임이 되어 읽기 나빠진다.
 */
html[lang='ko'],
html[lang='zh'] {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
html[lang='ko'] .brand-by,
html[lang='ja'] .brand-by,
html[lang='zh'] .brand-by {
  font-style: normal;
}

/* ---------- 언어 ----------
 * 언어판은 /ko/ /ja/ /zh/ 경로로 갈린다. 선택기는 같은 문서의 다른 언어로 보내되,
 * 그 언어에 해당 페이지가 없으면 그 언어의 첫 페이지로 떨어진다(빈 화면보다 낫다).
 */
.doc-lang {
  appearance: none;
  padding: 5px 24px 5px 10px;
  border: 1px solid var(--stroke-soft);
  border-radius: 999px;
  background:
    linear-gradient(transparent, transparent),
    var(--fill);
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.doc-lang:hover { color: var(--text); border-color: var(--stroke); }
.doc-lang-wrap { position: relative; display: inline-flex; align-items: center; }
.doc-lang-wrap::after {
  content: '▾';
  position: absolute;
  right: 9px;
  color: var(--faint);
  font-size: 10px;
  pointer-events: none;
}

/*
 * 번역이 영어 원문보다 낡을 수 있다는 사실을 숨기지 않는다.
 * 기준 날짜와 원문 링크를 본문 맨 위에 둔다.
 */
.doc-trans-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 9px 13px;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-sm);
  background: var(--sunken);
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.5;
}
.doc-trans-note a {
  color: var(--accent);
  white-space: nowrap;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
  /* 앵커로 이동했을 때 제목이 상단 바에 가리지 않게 한다 */
  scroll-padding-top: calc(var(--head-h) + 18px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.68;
  letter-spacing: -0.005em;
  background:
    radial-gradient(900px 620px at 6% -8%, rgb(91 108 255 / 0.14), transparent 62%),
    radial-gradient(760px 600px at 104% 4%, rgb(20 184 166 / 0.08), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; padding: 10px 16px; background: #11151f; border: 1px solid var(--stroke); }
.skip-link:focus { left: 0; }

/* ---------- top bar ---------- */
.doc-head {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--head-h);
  border-bottom: 1px solid var(--stroke-soft);
  background: rgb(7 9 13 / 0.86);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
}
/* 배경은 화면 전체를 덮되 내용물은 본문 격자와 같은 폭·같은 여백을 쓴다.
   그래야 브랜드와 사이드바의 왼쪽 선이 맞는다 */
.doc-head-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.doc-brand { display: flex; align-items: baseline; gap: 7px; color: inherit; min-width: 0; }
.doc-brand:hover { text-decoration: none; }
.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.03em;
  white-space: nowrap;
  background: linear-gradient(95deg, #ffffff 0%, #dbe6ff 42%, var(--mint) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-by {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--mint);
  white-space: nowrap;
}
.doc-tag {
  padding: 2px 9px;
  border: 1px solid var(--stroke-soft);
  border-radius: 999px;
  background: var(--sunken);
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.doc-head-links { display: flex; gap: 4px; margin-left: auto; }
.doc-head-links a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}
.doc-head-links a:hover { color: var(--text); background: var(--fill); text-decoration: none; }
.doc-head-links .cta {
  border: 1px solid var(--accent-dim);
  background: linear-gradient(180deg, rgb(138 180 255 / 0.28), rgb(138 180 255 / 0.14));
  color: var(--text);
}

/* 모바일에서만 보이는 사이드바 토글 */
.doc-menu {
  display: none;
  width: 34px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--stroke-soft);
  border-radius: 9px;
  background: var(--sunken);
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- shell ---------- */
.doc-shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w);
  gap: 34px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- sidebar ---------- */
.doc-side {
  position: sticky;
  top: var(--head-h);
  align-self: start;
  max-height: calc(100vh - var(--head-h));
  overflow-y: auto;
  padding: 24px 0 40px;
  scrollbar-width: thin;
}
.doc-search-wrap { position: relative; margin-bottom: 18px; }
.doc-search {
  width: 100%;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: var(--sunken);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
.doc-search::placeholder { color: var(--faint); }
.doc-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  max-height: 340px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: #0c1017;
  box-shadow: 0 24px 50px -24px rgb(0 0 0 / 0.9);
}
.doc-results:empty { display: none; }
.doc-results a {
  display: block;
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
.doc-results a:hover { background: var(--fill); text-decoration: none; }
.doc-results .where { display: block; color: var(--faint); font-size: 11px; }
.doc-results .none { padding: 9px; color: var(--faint); font-size: 12.5px; }

.doc-nav-group { margin-bottom: 20px; }
.doc-nav-title {
  margin: 0 0 7px;
  padding: 0 10px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.doc-nav { margin: 0; padding: 0; list-style: none; }
.doc-nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 400;
}
.doc-nav a:hover { color: var(--text); background: var(--fill); text-decoration: none; }
.doc-nav a.is-active {
  color: var(--text);
  background: var(--fill);
  box-shadow: inset 2px 0 0 var(--accent);
}

/* ---------- main column ---------- */
.doc-main { min-width: 0; padding: 30px 0 90px; }

.crumb { margin-bottom: 12px; color: var(--faint); font-size: 12px; letter-spacing: 0.04em; }
.crumb a { color: var(--faint); }

.doc-body h1 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 4vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.16;
}
.doc-lede { margin: 0 0 30px; color: var(--muted); font-size: 1.02rem; line-height: 1.65; }

.doc-body h2 {
  margin: 44px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--stroke-soft);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.doc-body h3 { margin: 28px 0 10px; font-size: 1.04rem; font-weight: 600; letter-spacing: -0.02em; }
.doc-body h2:first-of-type { margin-top: 34px; }

/* 제목 옆 앵커. 마우스를 올렸을 때만 보인다 */
.anchor { margin-left: 8px; color: var(--faint); font-weight: 400; opacity: 0; transition: opacity 0.15s; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; text-decoration: none; }

.doc-body p { margin: 0 0 15px; }
.doc-body ul, .doc-body ol { margin: 0 0 16px; padding-left: 20px; }
.doc-body li { margin-bottom: 7px; }
.doc-body li::marker { color: var(--faint); }
.doc-body strong { font-weight: 600; color: var(--text); }
.doc-body hr { margin: 34px 0; border: 0; border-top: 1px solid var(--stroke-soft); }

.doc-body code {
  padding: 1.5px 6px;
  border: 1px solid var(--stroke-soft);
  border-radius: 6px;
  background: var(--sunken);
  font-size: 0.86em;
  color: #dbe6ff;
}
.doc-body pre {
  margin: 0 0 18px;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-sm);
  background: var(--sunken);
  font-size: 12.5px;
  line-height: 1.6;
}
.doc-body pre code { padding: 0; border: 0; background: none; color: var(--muted); }

/* 키 입력 표기 */
.kbd {
  padding: 2px 7px;
  border: 1px solid var(--stroke);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--fill);
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--text);
}

/* ---------- tables ---------- */
.doc-body table {
  width: 100%;
  margin: 0 0 20px;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.doc-body th, .doc-body td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--stroke-soft);
  text-align: left;
  vertical-align: top;
}
.doc-body th {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.doc-body td { color: var(--muted); }
.doc-body td strong { color: var(--text); }
.doc-body tbody tr:last-child td { border-bottom: 0; }

/* ---------- status badges ----------
   컨트랙트가 하나도 배포되지 않았으므로, 설계 의도가 확정 사실로 읽히지 않도록
   항목마다 상태를 붙인다. */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border: 1px solid var(--stroke-soft);
  border-radius: 999px;
  background: var(--sunken);
  color: var(--faint);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-live { border-color: rgb(52 211 153 / 0.45); color: var(--up); }
.badge-planned { border-color: rgb(251 191 36 / 0.45); color: var(--gold); }
.badge-tbd { border-color: var(--stroke); color: var(--faint); }

/* ---------- callouts ---------- */
.callout {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--stroke-soft);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: var(--sunken);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
.callout > :last-child { margin-bottom: 0; }
.callout-title { display: block; margin-bottom: 5px; color: var(--text); font-weight: 600; font-size: 0.92rem; }
.callout-note { border-left-color: var(--accent-dim); }
.callout-warn { border-left-color: rgb(251 191 36 / 0.6); background: rgb(251 191 36 / 0.05); }
.callout-stop { border-left-color: rgb(251 113 133 / 0.6); background: rgb(251 113 133 / 0.05); }

/* ---------- screenshots ---------- */
.shot {
  margin: 0 0 22px;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--sunken);
  box-shadow: 0 14px 30px -18px rgb(0 0 0 / 0.9);
}
.shot img { width: 100%; height: auto; }
.shot figcaption {
  padding: 8px 12px;
  border-top: 1px solid var(--stroke-soft);
  color: var(--faint);
  font-size: 12px;
}

/* ---------- cards on the index ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 13px;
  margin-bottom: 26px;
}
.doc-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: inherit;
  transition: border-color 0.18s, transform 0.18s;
}
.doc-card:hover { border-color: rgb(138 180 255 / 0.4); transform: translateY(-2px); text-decoration: none; }
.doc-card h3 { margin: 0 0 6px; font-size: 0.98rem; font-weight: 600; }
.doc-card p { margin: 0; color: var(--muted); font-size: 0.87rem; line-height: 1.55; }

/* ---------- page footer nav ---------- */
.doc-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 54px;
  padding-top: 22px;
  border-top: 1px solid var(--stroke-soft);
}
.doc-foot a {
  flex: 1 1 210px;
  padding: 13px 16px;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radius-sm);
  color: inherit;
}
.doc-foot a:hover { border-color: var(--accent-dim); text-decoration: none; }
.doc-foot .dir { display: block; color: var(--faint); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.doc-foot .next { text-align: right; }

/* ---------- right-hand table of contents ---------- */
.doc-toc {
  position: sticky;
  top: var(--head-h);
  align-self: start;
  max-height: calc(100vh - var(--head-h));
  overflow-y: auto;
  padding: 34px 0 40px;
}
.doc-toc-title { margin: 0 0 9px; color: var(--faint); font-size: 10.5px; font-weight: 500; letter-spacing: 0.13em; text-transform: uppercase; }
.doc-toc ul { margin: 0; padding: 0; list-style: none; }
.doc-toc a {
  display: block;
  padding: 4px 0 4px 11px;
  border-left: 1px solid var(--stroke-soft);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.doc-toc a:hover { color: var(--text); text-decoration: none; }
.doc-toc a.is-active { color: var(--text); border-left-color: var(--accent); }
.doc-toc .lvl3 { padding-left: 22px; font-size: 12px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .doc-shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .doc-toc { display: none; }
}

@media (max-width: 860px) {
  .doc-shell { grid-template-columns: minmax(0, 1fr); }
  .doc-menu { display: block; }
  .doc-head-links a:not(.cta) { display: none; }
  /* 좁은 화면에서는 사이드바를 덮개로 띄운다 */
  .doc-side {
    position: fixed;
    inset: var(--head-h) auto 0 0;
    z-index: 45;
    width: 284px;
    max-height: none;
    padding: 20px 16px 40px;
    border-right: 1px solid var(--stroke);
    background: #0a0d13;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
  }
  body.side-open .doc-side { transform: none; }
  body.side-open::after {
    content: '';
    position: fixed;
    inset: var(--head-h) 0 0;
    z-index: 44;
    background: rgb(0 0 0 / 0.55);
  }
  .doc-main { padding-top: 22px; }
}
