:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1c1b19;
  --muted: #6b6860;
  --line: #e4e1d8;
  --accent: #1f5f4a;
  --accent-soft: #e3efe9;
  --term: #7a4b12;
  --max: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151614;
    --surface: #1d1f1c;
    --text: #e9e7e1;
    --muted: #9c998f;
    --line: #2e302c;
    --accent: #7fc8ab;
    --accent-soft: #1f3129;
    --term: #e0b070;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.75 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

header.site, main, footer.site { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
header.site { display: flex; align-items: baseline; justify-content: space-between; padding-top: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
header.site nav a { margin-left: 1.25rem; color: var(--muted); text-decoration: none; }
header.site nav a:hover { color: var(--text); }
footer.site { margin-top: 4rem; padding-top: 1.5rem; padding-bottom: 3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
footer.site p { margin: 0.25rem 0; }

.hero { padding: 3rem 0 1.5rem; }
.hero h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 0.75rem; text-wrap: balance; }
.hero p { color: var(--muted); margin: 0; }

.filters { padding: 1rem 0 0.5rem; }
input[type="search"], input[type="email"] {
  width: 100%; padding: 0.7rem 0.9rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.chip { font: inherit; font-size: 0.85rem; padding: 0.25rem 0.75rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.count { color: var(--muted); font-size: 0.85rem; margin: 0.75rem 0 0; }

.cards { list-style: none; margin: 0; padding: 0; }
.card { border-bottom: 1px solid var(--line); }
.card a { display: block; padding: 1.25rem 0; color: inherit; text-decoration: none; }
.card h2 { font-size: 1.15rem; line-height: 1.4; margin: 0.2rem 0 0.4rem; letter-spacing: -0.01em; }
.card a:hover h2 { color: var(--accent); }
.excerpt { margin: 0; color: var(--muted); font-size: 0.95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0; color: var(--muted); font-size: 0.8rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.tag { background: var(--accent-soft); color: var(--accent); padding: 0 0.5rem; border-radius: 4px; font-size: 0.75rem; }
.empty { color: var(--muted); padding: 2rem 0; }

.post { padding-top: 2.5rem; }
.post h1 { font-size: clamp(1.5rem, 4.5vw, 2rem); line-height: 1.35; letter-spacing: -0.02em; margin: 0.4rem 0 0.75rem; text-wrap: balance; }
.post h2 { font-size: 1.15rem; margin: 2.25rem 0 0.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.post h3 { font-size: 1rem; margin: 1.25rem 0 0.25rem; }
.post ul, .post ol { padding-left: 1.3rem; margin: 0.5rem 0; }
.post li { margin: 0.3rem 0; }
.post li > ul, .post li > ol { margin: 0.2rem 0; }
.post code { font: 0.88em ui-monospace, "SF Mono", Menlo, monospace; background: var(--accent-soft); padding: 0.1em 0.35em; border-radius: 4px; }
.term { color: var(--term); }
.source { font-weight: 600; }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; font-size: 0.9rem; min-width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 0.45rem 0.75rem; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }

.subscribe { margin-top: 3rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.subscribe h2 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.subscribe p { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.95rem; }
.subscribe form { display: flex; gap: 0.5rem; }
.subscribe button { font: inherit; font-weight: 600; padding: 0 1.2rem; border: 0; border-radius: 8px; background: var(--accent); color: var(--bg); cursor: pointer; white-space: nowrap; }
.subscribe .note { margin: 0.75rem 0 0; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.pager a { display: block; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; font-size: 0.9rem; line-height: 1.45; }
.pager a span { display: block; color: var(--muted); font-size: 0.75rem; margin-bottom: 0.2rem; }
.pager a.next { text-align: right; }
.pager a:hover { border-color: var(--accent); }
@media (max-width: 34rem) {
  .pager { grid-template-columns: 1fr; }
  .pager a.next { text-align: left; }
  .subscribe form { flex-direction: column; }
  .subscribe button { padding: 0.7rem; }
}

/* 브리핑, 가이드, 구독 */
header.site { flex-wrap: wrap; gap: 0.5rem 1rem; }
header.site nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
header.site nav a { margin-left: 0; font-size: 0.95rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin: 1rem 0 0; }
.button { display: inline-block; padding: 0.55rem 1.1rem; border-radius: 8px; background: var(--accent); color: var(--bg); font-weight: 600; text-decoration: none; }
.button:hover { opacity: 0.9; }
.subscribe .actions { margin-top: 0.75rem; }
.subscribe form { margin-bottom: 0.25rem; }
form.inline { display: flex; gap: 0.5rem; margin: 0.75rem 0; }
form.inline button { font: inherit; font-weight: 600; padding: 0 1.2rem; border: 0; border-radius: 8px; background: var(--accent); color: var(--bg); cursor: pointer; white-space: nowrap; }
.lede { color: var(--muted); font-size: 0.95rem; margin: 0; }
a.tag { text-decoration: none; }
a.tag:hover { text-decoration: underline; }
.index { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.index li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.index a { font-weight: 600; text-decoration: none; color: var(--text); }
.index a:hover { color: var(--accent); }
.index span { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.post .cards { padding-left: 0; }
.post .cards li { margin: 0; }
.operator { color: var(--text); }
@media (max-width: 34rem) { form.inline { flex-direction: column; } form.inline button { padding: 0.7rem; } }
.post .cards h2 { border: 0; padding: 0; margin: 0.2rem 0 0.4rem; font-size: 1.1rem; }
.post h2 + .cards { margin-top: 0; }
.post ol.path { padding-left: 1.3rem; }
.post ol.path li { margin: 0.7rem 0; }
.post ol.path a { font-weight: 600; text-decoration: none; }
.post ol.path a:hover { text-decoration: underline; }
code.math { background: transparent; padding: 0; font-style: italic; }
.editor { padding: 0.5rem 0 1.5rem; }
.editor > h2, .list-title { font-size: 0.85rem; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; margin: 0 0 0.75rem; }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.editor > h2 { grid-column: 1 / -1; margin-bottom: 0; }
.editor article { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; }
.editor h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.editor h3 a { color: var(--text); text-decoration: none; }
.editor p { margin: 0; font-size: 0.93rem; line-height: 1.65; }
.editor .more { margin-top: 0.6rem; font-size: 0.85rem; }
@media (max-width: 40rem) { .editor { grid-template-columns: 1fr; } }
