:root {
  --fg: #1b1f24;
  --muted: #5b6470;
  --line: #e3e7ec;
  --bg: #ffffff;
  --soft: #f6f8fa;
  --accent: #17416b;
  --accent-soft: #eaf1f8;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: "Pretendard Variable", "Pretendard", system-ui, -apple-system, "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
}

code {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

pre {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  line-height: 1.55;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 1em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.4rem;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--fg);
}

.top-nav { display: flex; gap: 1.1rem; font-size: 0.9rem; }
.top-nav a { color: var(--muted); }
.top-nav a:hover { color: var(--accent); }

.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.2rem 1.4rem 4rem;
}

.sidebar {
  position: sticky;
  top: 4.2rem;
  align-self: start;
  max-height: calc(100vh - 5rem);
  overflow-y: auto;
  font-size: 0.88rem;
  border-right: 1px solid var(--line);
  padding-right: 1.2rem;
}

.side-label {
  margin: 1.2rem 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.side-label:first-child { margin-top: 0; }

.side-nav ol, .side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-nav li { margin: 0.15rem 0; }

.side-nav a {
  display: block;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  color: var(--muted);
}

.side-nav a:hover { background: var(--soft); color: var(--fg); text-decoration: none; }
.side-nav li.active > a { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.content { min-width: 0; max-width: 820px; }

.doc h1 {
  margin: 0 0 1.2rem;
  font-size: 2rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.doc h2 {
  margin: 2.4rem 0 0.8rem;
  font-size: 1.35rem;
  line-height: 1.4;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.doc h3 { margin: 1.8rem 0 0.6rem; font-size: 1.1rem; }
.doc p { margin: 0.9rem 0; }
.doc ul, .doc ol { padding-left: 1.4rem; }
.doc li { margin: 0.3rem 0; }

.doc blockquote {
  margin: 1.2rem 0;
  padding: 0.2rem 1rem;
  border-left: 3px solid var(--accent-soft);
  color: var(--muted);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.92rem;
}

.doc th, .doc td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

.doc th { background: var(--soft); font-weight: 600; }

.doc img { max-width: 100%; height: auto; }

.lead { font-size: 1.08rem; color: var(--muted); }

.pipeline {
  font-size: 0.95rem;
  text-align: center;
  background: var(--accent-soft);
  border-color: #cfe0f0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.6rem 0;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.2rem 1rem 0.4rem;
}

.card h2 {
  margin: 0.7rem 0 0.3rem;
  font-size: 1rem;
  border: 0;
  padding: 0;
}

.card p { margin: 0.4rem 0 0.6rem; font-size: 0.92rem; color: var(--muted); }

.button {
  display: inline-block;
  margin: 0.4rem 0.5rem 0.4rem 0;
  padding: 0.55rem 1.05rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
}

.button:hover { text-decoration: none; opacity: 0.92; }
.button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.doc-list { columns: 2; column-gap: 2rem; font-size: 0.95rem; }

.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 1.4rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.compare-col { padding: 0.2rem 1rem 0.6rem; min-width: 0; }
.compare-col + .compare-col { border-left: 1px solid var(--line); background: #fbfcfd; }
.compare-col h3 { margin-top: 0.8rem; font-size: 0.95rem; }
.compare-col pre { font-size: 0.8rem; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 1.4rem 2.4rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer p { margin: 0.35rem 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 1.4rem; padding-top: 1.2rem; }
  .sidebar { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 1rem; }
  .content { max-width: none; }
  .cards { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .compare-col + .compare-col { border-left: 0; border-top: 1px solid var(--line); }
  .doc-list { columns: 1; }
  .doc h1 { font-size: 1.6rem; }
}

/* landing page: no sidebar column */
.shell.no-sidebar { grid-template-columns: minmax(0, 1fr); max-width: 900px; }

/* keep the pipeline readable on narrow viewports */
.pipeline { white-space: pre-wrap; overflow-wrap: anywhere; }

/* cards adapt instead of squeezing */
.cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.site-footer .legal { max-width: 62ch; margin-left: auto; margin-right: auto; font-size: 0.72rem; }
