:root {
  --bg: #fbfcfb;
  --surface: #ffffff;
  --surface-alt: #eef4f0;
  --text: #17201b;
  --text-muted: #4a5a51;
  --primary: #0f7a41;
  --primary-on: #ffffff;
  --outline: #cfdcd3;
  --code-bg: #eef2ef;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1411;
    --surface: #161d19;
    --surface-alt: #1b2520;
    --text: #e6eee9;
    --text-muted: #a5b5ab;
    --primary: #4cc983;
    --primary-on: #06210f;
    --outline: #2c3a32;
    --code-bg: #1f2a24;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.75;
  font-size: 1rem;
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--primary-on); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; }

.site-header { border-bottom: 1px solid var(--outline); background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.15rem; text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-nav a { color: var(--text-muted); text-decoration: none; padding: 8px 2px; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }

main { padding: 40px 0 64px; }
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.25; margin: 0 0 12px; }
.hero .lead { font-size: 1.15rem; color: var(--text-muted); max-width: 40em; margin: 0 0 20px; }
.badge { display: inline-block; padding: 4px 14px; border: 1px solid var(--primary); color: var(--primary); border-radius: 999px; font-weight: 600; font-size: 0.9rem; }
.hero__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.button { display: inline-block; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--primary); color: var(--primary); text-decoration: none; font-weight: 600; }
.button--filled { background: var(--primary); color: var(--primary-on); }
.button:hover { text-decoration: underline; }

h1 { font-size: clamp(1.7rem, 4vw, 2.2rem); line-height: 1.3; margin: 0 0 12px; }
h2 { font-size: 1.45rem; line-height: 1.4; margin: 48px 0 12px; padding-top: 8px; }
h3 { font-size: 1.1rem; margin: 28px 0 6px; }
p { margin: 0 0 14px; }
ul, ol { padding-left: 1.4em; margin: 0 0 14px; }
li { margin-bottom: 6px; }
.prose { max-width: 46em; }
.muted { color: var(--text-muted); }
.meta { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 24px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 16px 0; }
.card { background: var(--surface); border: 1px solid var(--outline); border-radius: 12px; padding: 18px 20px; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

figure { margin: 24px 0; }
figure img { width: 100%; height: auto; border: 1px solid var(--outline); border-radius: 10px; display: block; }
figcaption { color: var(--text-muted); font-size: 0.92rem; margin-top: 8px; }

.table-scroll { overflow-x: auto; margin: 12px 0 20px; }
table { border-collapse: collapse; width: 100%; min-width: 600px; background: var(--surface); }
th, td { border: 1px solid var(--outline); padding: 8px 12px; text-align: left; vertical-align: top; word-break: keep-all; }
td code { word-break: break-all; }
th { background: var(--surface-alt); font-weight: 600; }
kbd { background: var(--code-bg); border: 1px solid var(--outline); border-radius: 4px; padding: 1px 6px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.9em; }

picture { display: block; }
.wrap--wide { max-width: 1160px; }
.doc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.doc-main { min-width: 0; }
.doc-main.prose { max-width: 52em; }
.doc-main h2 { scroll-margin-top: 16px; }
.doc-toc { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
.doc-toc__title { margin: 0 0 8px; font-weight: 700; }
.doc-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--outline); }
.doc-toc li { margin: 0; }
.doc-toc a { display: block; margin-left: -2px; padding: 5px 12px; border-left: 2px solid transparent; color: var(--text-muted); text-decoration: none; font-size: 0.93rem; line-height: 1.5; }
.doc-toc a:hover { color: var(--text); }
.doc-toc a[aria-current="true"] { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
@media (max-width: 900px) {
  .doc-layout { display: block; }
  .doc-toc { position: static; max-height: none; overflow: visible; background: var(--surface-alt); border-radius: 12px; padding: 14px 20px; margin-bottom: 24px; }
  .doc-toc ol { columns: 2; column-gap: 24px; border-left: 0; }
  .doc-toc a { margin-left: 0; padding: 4px 0; border-left: 0; }
  .doc-toc a[aria-current="true"] { border-left: 0; }
}
@media (max-width: 560px) { .doc-toc ol { columns: 1; } }

.note { border-left: 4px solid var(--primary); background: var(--surface-alt); padding: 10px 16px; border-radius: 0 8px 8px 0; margin: 16px 0; }

.email span { display: inline; }
.email__decoy { display: none; }

.lang-section { border-top: 1px solid var(--outline); margin-top: 56px; padding-top: 8px; }

.site-footer { border-top: 1px solid var(--outline); background: var(--surface); padding: 24px 0 32px; color: var(--text-muted); font-size: 0.92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--text-muted); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
