:root {
  --fg: #1d1d1f; --bg: #fdfdfb; --muted: #5f6368; --line: #d9d9d4; --accent: #0b5cad;
  --note: #f2f5f9; --note-line: #8aa6c7; --code: #f4f4f1; --head: #eef1f4;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6e6e3; --bg: #17181a; --muted: #a2a6ab; --line: #3a3c40; --accent: #7fb6f0;
    --note: #1f252d; --note-line: #4f6e92; --code: #222427; --head: #23272c;
  }
  img { background: #fff; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; padding: 0 16px; color: var(--fg); background: var(--bg);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.75; word-break: keep-all; overflow-wrap: break-word;
}
main, .site-header, .pager, .site-footer { max-width: 46rem; margin: 0 auto; }
a { color: var(--accent); }
.site-header { padding: 1rem 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.site-header a { text-decoration: none; color: var(--fg); }
.pager { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; font-size: .9rem; }
.pager a { text-decoration: none; }
.pager a[rel=next] { text-align: right; }
h1 { font-size: 1.8rem; line-height: 1.35; margin: 1.5rem 0 1rem; }
h2 { font-size: 1.4rem; line-height: 1.4; margin-top: 2.2rem; }
h3 { font-size: 1.15rem; margin-top: 1.8rem; }
h4, h5, h6 { font-size: 1rem; }
.num { color: var(--muted); margin-right: .3em; }
.subtitle { color: var(--muted); }
img { max-width: 100%; height: auto; }
figure { margin: 1.5rem 0; text-align: center; }
figure.scaled-down img { max-width: min(100%, 36rem); }
figure.scaled-down-30 img { max-width: min(100%, 20rem); }
figcaption, caption { font-size: .9rem; color: var(--muted); text-align: left; margin-top: .5rem; }
figcaption .label, caption .label { font-weight: 700; color: var(--fg); margin-right: .3em; }
figcaption .title, caption .title { font-weight: 600; color: var(--fg); }
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table { border-collapse: collapse; font-size: .9rem; min-width: 50%; }
caption { caption-side: top; margin-bottom: .5rem; }
th, td { border: 1px solid var(--line); padding: .35rem .6rem; vertical-align: top; }
th { background: var(--head); }
td.right, th.right { text-align: right; } td.center, th.center { text-align: center; }
tr.gray-shading td { background: var(--head); }
.equation { overflow-x: auto; overflow-y: hidden; margin: 1rem 0; text-align: center; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
pre.code { background: var(--code); padding: .75rem 1rem; overflow-x: auto; line-height: 1.5; }
pre.centered-code { text-align: center; }
kbd { border: 1px solid var(--line); border-radius: 3px; padding: 0 .3em; background: var(--code); }
kbd.secondary-function { font-style: italic; }
.blue-code { color: #2a62c9; } .red-code { color: #c0392b; }
dfn.term { font-style: normal; font-weight: 700; }
aside.note, section.learning-objectives {
  background: var(--note); border-left: 4px solid var(--note-line); padding: .5rem 1rem; margin: 1.5rem 0;
}
section.learning-objectives h2 { margin-top: .5rem; font-size: 1.1rem; }
.note-head { font-weight: 700; margin: .5rem 0; }
.note-label { display: inline-block; font-size: .8rem; color: var(--muted); margin-right: .6em; }
.exercise { border-top: 1px dashed var(--line); padding-top: .5rem; margin-top: 1rem; }
details.solution { margin: .5rem 0 1rem; }
details.solution summary { cursor: pointer; font-weight: 600; }
.exercise-embed { border: 1px solid var(--line); border-radius: 6px; padding: .25rem 1rem; margin: 1rem 0; font-size: .95rem; }
.video-link .host { color: var(--muted); font-size: .85rem; }
ul.plain { list-style: none; padding-left: 0; }
.outline ul, .toc ul { padding-left: 1.2rem; }
.toc > ul > li { margin-top: .6rem; font-weight: 600; }
.toc > ul > li li { font-weight: 400; }
dl.glossary dt { font-weight: 700; margin-top: 1rem; }
dl.glossary dd { margin-left: 0; }
.footnotes { font-size: .85rem; border-top: 1px solid var(--line); margin-top: 3rem; }
.footnotes h2 { font-size: 1rem; }
.fn-ref a { text-decoration: none; }
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; padding: 1rem 0 3rem; font-size: .8rem; color: var(--muted); }
