/* Bable 조사 노트 — public site. Look = the "paper + forest ink + sage green" concept of the user's own site (이음):
   pale paper background, forest-colored text, sage-green accent, white cards with thin lines and 8-12px corners, almost no shadow,
   small caps English eyebrow + big Korean title + green dot, pale pill tags, one deep-green accent card.
   Contrast (WCAG): ink 11.8, body/sub/muted >= 5.4 on paper; green 5.4 on paper / 4.9 on pale; every tag pair >= 5.5. */
:root {
  --paper: #fafbf7; --card: #fffefa; --sidebar: #f2f4ec; --pale: #edf1e1; --pale-sel: #e4ebd7;
  --ink: #29392e; --body: #34443a; --sub: #44523f; --muted: #566152;
  --line: #e5e8dd; --line2: #d3d9c7;
  --green: #586e48; --green-dark: #445b35; --green-text: #3f5530;
  --deep: #2f4535; --deep-ink: #f0f2e6; --deep-sub: #c9d4bd; --deep-line: #4a6150;
  --code-bg: #f4f6ee;
  --yellow: #e7cd77; --lavender: #c5b8dc; --orange: #dc9e78;
  --r-sm: 8px; --r-md: 10px; --r-lg: 12px;
  --sans: 'DM Sans', 'Noto Sans KR', system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); font-family: var(--sans); color: var(--ink); min-height: 100vh; word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased; }
#app { min-height: 100vh; display: flex; flex-direction: column; }
#app > .site-footer { margin-top: auto; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.dot { color: var(--green); }

/* header / footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.head-in { padding-top: 16px; padding-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.brand, .brand:hover { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: var(--r-sm); background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; line-height: 1; }
.brand-name { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand-sub { font-size: 14px; color: var(--muted); }
.mainnav { display: flex; flex-wrap: wrap; gap: 4px; font-size: 15px; }
.mainnav a { color: var(--sub); padding: 8px 14px; border-radius: var(--r-sm); min-height: 40px; display: inline-flex; align-items: center; }
.mainnav a:hover { background: var(--sidebar); color: var(--ink); text-decoration: none; }
.mainnav a.cur { background: var(--pale-sel); color: var(--green-text); font-weight: 700; }
.site-footer { border-top: 1px solid var(--line); background: var(--sidebar); }
.foot-in { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: 14px; color: var(--muted); }

/* eyebrow: small caps English line with a green dot */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex: none; }

/* ── home ── */
.hero { padding-top: 56px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 14px; }
.hero h1 { margin: 0; font-size: 40px; line-height: 1.3; font-weight: 700; letter-spacing: -0.03em; max-width: 780px; }
.hero > p { margin: 0; font-size: 16px; line-height: 1.7; color: var(--muted); max-width: 640px; }
.hero-cards { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; padding-bottom: 36px; }
.intro { background: var(--pale); border: 1px solid var(--pale-sel); border-radius: var(--r-lg); padding: 36px 40px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.intro h2 { margin: 0; font-size: 29px; line-height: 1.4; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.intro p { margin: 0; font-size: 16px; line-height: 1.75; color: var(--sub); max-width: 520px; }
.intro .more { margin-top: 6px; align-self: flex-start; }
.more { font-weight: 700; font-size: 15px; color: var(--green-text); }
.more:hover { color: var(--ink); }
.latest, .latest:hover { background: var(--deep); color: var(--deep-ink); border-radius: var(--r-lg); padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 14px; text-decoration: none; min-height: 240px; }
.latest .eyebrow { color: var(--deep-sub); }
.latest .eyebrow::before { background: #a9bf93; }
.latest-title { margin: 0; font-size: 21px; line-height: 1.45; font-weight: 700; letter-spacing: -0.015em; color: var(--deep-ink); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.latest-meta { font-size: 13px; color: var(--deep-sub); }
.latest-go { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--deep-line); display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 15px; color: var(--deep-ink); }
.latest:hover .latest-go span:last-child { transform: translateX(3px); }
.latest-go span:last-child { transition: transform .15s; }
.latest.none { min-height: 0; }

.posts { padding-top: 12px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 14px; }
.posts-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding-bottom: 6px; }
.posts-head h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; }
.filters button { min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--sub); font: 500 14px var(--sans); cursor: pointer; }
.filters button:hover { background: var(--sidebar); color: var(--ink); }
.filters button.on { background: var(--pale-sel); color: var(--green-text); font-weight: 700; }
.post { display: flex; flex-direction: column; gap: 12px; padding: 24px 28px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; transition: border-color .15s; }
.post:hover { color: var(--ink); text-decoration: none; border-color: var(--line2); }
.post:hover h3 { color: var(--green); }
.post-meta { display: flex; align-items: center; gap: 12px; }
.date { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.post-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.post-main h3 { margin: 0; font-size: 22px; line-height: 1.45; font-weight: 700; letter-spacing: -0.015em; }
.post-main p { margin: 0; font-size: 16px; line-height: 1.75; color: var(--sub); max-width: 760px; }
.src { font-family: var(--mono); font-size: 13px; color: var(--muted); overflow-wrap: anywhere; padding-top: 4px; }
.empty { margin: 0; padding: 20px 24px; font-size: 15px; color: var(--muted); border: 1px dashed var(--line2); border-radius: var(--r-md); text-align: center; }

/* pale pill tags: type colors (green / yellow / lavender / orange) */
.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--pale-sel); color: var(--green-text); font-size: 13px; font-weight: 700; line-height: 1.5; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.badge.t-log { background: #f8efc6; color: #6b5410; }
.badge.t-log::before { background: var(--yellow); }
.badge.t-lite { background: #e9e3f3; color: #5a4a82; }
.badge.t-lite::before { background: var(--lavender); }
.badge.t-news { background: #f9e4d3; color: #8a4a1c; }
.badge.t-news::before { background: var(--orange); }

.types { padding-top: 40px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 24px; border-top: 1px solid var(--line); margin-top: 8px; }
.types-head { display: flex; flex-direction: column; gap: 10px; }
.types-head h2 { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.types-head p { margin: 0; font-size: 16px; line-height: 1.7; color: var(--sub); max-width: 640px; }
.type-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.type { padding: 20px 20px 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; gap: 10px; }
.type .no { align-self: flex-start; font-family: var(--mono); font-size: 13px; font-weight: 400; padding: 2px 9px; border-radius: 999px; background: var(--pale-sel); color: var(--green-text); }
.type:nth-child(2) .no { background: #f8efc6; color: #6b5410; }
.type:nth-child(3) .no { background: #e9e3f3; color: #5a4a82; }
.type:nth-child(4) .no { background: #f9e4d3; color: #8a4a1c; }
.type h3 { margin: 0; font-size: 17px; font-weight: 700; }
.type p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--sub); }

/* ── post ── */
.post-hero { width: 100%; max-width: 1120px; margin: 0 auto; padding: 44px 32px 36px; display: flex; flex-direction: column; gap: 16px; }
.crumb { font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.crumb a { color: var(--sub); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 3px 10px; border-radius: 999px; background: var(--sidebar); border: 1px solid var(--line); color: var(--sub); font-size: 13px; }
.post-hero h1 { margin: 0; font-size: 36px; line-height: 1.4; font-weight: 700; letter-spacing: -0.025em; max-width: 860px; }
.metaline { display: flex; flex-wrap: wrap; gap: 8px 24px; font-family: var(--mono); font-size: 13px; color: var(--muted); }

.post-body { width: 100%; max-width: 1120px; margin: 0 auto; padding: 8px 32px 80px; display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.toc { flex: 1 1 200px; max-width: 220px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; position: sticky; top: 16px; }
.toc-label { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; color: var(--muted); padding: 0 12px 10px; }
.toc-label::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.toc a { padding: 7px 12px; border-radius: var(--r-sm); color: var(--sub); line-height: 1.5; }
.toc a:hover { background: var(--sidebar); color: var(--ink); text-decoration: none; }
.toc a.on { background: var(--pale-sel); color: var(--green-text); font-weight: 700; }
.article { flex: 999 1 600px; min-width: 0; max-width: 740px; display: flex; flex-direction: column; gap: 48px; font-size: 17px; line-height: 1.9; color: var(--body); }
.article p { margin: 0; }
.article img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.article code { font: 0.88em/1.6 var(--mono); background: var(--code-bg); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; color: var(--ink); }
.article pre code { padding: 0; background: none; border: 0; font: inherit; overflow-wrap: normal; }
.article a { text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.article a:hover { text-decoration-color: var(--green); }

.summary { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px 24px; }
.summary .row { display: grid; grid-template-columns: minmax(110px, 140px) minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.summary .row:last-child { border-bottom: 0; }
.summary .k { font-size: 14px; font-weight: 700; color: var(--green-text); padding-top: 3px; }
.summary .v { font-size: 16px; line-height: 1.75; }
.todo, .summary .v.todo { color: var(--muted); }

.sec { display: flex; flex-direction: column; gap: 18px; }
.sec h2 { margin: 0; font-size: 26px; line-height: 1.4; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.sec h3 { margin: 10px 0 0; font-size: 19px; font-weight: 700; line-height: 1.5; color: var(--ink); }
.sec ul, .sec ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.sec li::marker { color: var(--green); }
.sec li p + p, .sec li p + pre { margin-top: 8px; }
.sec strong { font-weight: 700; color: var(--ink); }
.sec-caution { gap: 14px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats > div { padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); display: flex; flex-direction: column; gap: 2px; }
.stats .n { font-size: 30px; font-weight: 700; color: var(--green); line-height: 1.3; }
.stats .l { font-size: 14px; color: var(--muted); line-height: 1.6; }

.steps ol { padding: 0; list-style: none; gap: 14px; counter-reset: step; }
.steps li { position: relative; display: flex; flex-direction: column; gap: 10px; counter-increment: step; padding: 18px 20px 18px 64px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
.steps li::before { content: counter(step); position: absolute; left: 20px; top: 17px; width: 30px; height: 30px; border-radius: 50%; background: var(--pale-sel); color: var(--green-text); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps li > * { margin: 0; }
.steps li > p { font-weight: 700; color: var(--ink); }
.steps li > p strong { font-weight: 700; }
.steps li > p.plain { font-weight: 400; }

pre { margin: 0; padding: 14px 18px; border-radius: var(--r-sm); background: var(--code-bg); border: 1px solid var(--line); color: var(--ink); font: 14.5px/1.65 var(--mono); overflow-x: auto; }
.callout { padding: 18px 22px; background: var(--pale); border: 1px solid var(--pale-sel); border-radius: var(--r-md); font-size: 16px; line-height: 1.75; color: var(--body); display: flex; flex-direction: column; gap: 10px; }
.callout strong { color: var(--green-text); font-weight: 700; }
.callout ul { gap: 6px; }

.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
th { text-align: left; font-weight: 700; color: var(--green-text); background: var(--sidebar); padding: 11px 16px; border-bottom: 1px solid var(--line); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

.sec-opinion { gap: 14px; padding: 26px 28px; background: var(--pale); border: 1px solid var(--pale-sel); border-radius: var(--r-lg); }
.sec-opinion h2 { font-size: 22px; }
.video { display: flex; flex-direction: column; gap: 12px; }
.video h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink); }
.videobox { aspect-ratio: 16 / 9; border: 1px dashed var(--line2); border-radius: var(--r-lg); background: var(--sidebar); display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.sec-sources { gap: 10px; padding-top: 28px; border-top: 1px solid var(--line); }
.sec-sources h2 { font-size: 18px; }
.sec-sources ul { font-size: 15px; line-height: 1.9; color: var(--sub); gap: 0; }
.sec-sources li { overflow-wrap: anywhere; }

/* ── phone and narrow windows ── */
@media (max-width: 900px) {
  .hero-cards { grid-template-columns: minmax(0, 1fr); }
  .latest, .latest:hover { min-height: 0; }
  .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .toc { flex-basis: 100%; max-width: none; position: static; }
  .article { flex-basis: 100%; }
}
@media (max-width: 720px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .head-in { flex-direction: column; align-items: flex-start; gap: 8px; }
  .mainnav { margin-left: -14px; }
  .hero { padding-top: 32px; padding-bottom: 20px; gap: 12px; }
  .hero h1 { font-size: 29px; }
  .hero > p { font-size: 16px; }
  .hero-cards { padding-bottom: 24px; }
  .intro { padding: 26px 22px; }
  .intro h2 { font-size: 23px; }
  .latest, .latest:hover { padding: 24px 22px 20px; }
  .latest-title { font-size: 19px; }
  .post { padding: 20px 18px; gap: 10px; }
  .post-main h3 { font-size: 20px; }
  .types { padding-top: 32px; padding-bottom: 48px; }
  .type-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-in { flex-direction: column; gap: 8px; padding-top: 24px; padding-bottom: 24px; }

  .post-hero { padding: 28px 20px 24px; gap: 14px; }
  .post-hero h1 { font-size: 27px; }
  .post-body { padding: 4px 20px 56px; gap: 28px; }
  .toc { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
  .toc a { padding: 9px 12px; }
  .article { gap: 40px; font-size: 16px; }
  .summary { padding: 4px 18px; }
  .summary .row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .sec h2 { font-size: 22px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats > div { padding: 14px; }
  .stats .n { font-size: 26px; }
  .steps li { padding: 16px 14px 16px 52px; }
  .steps li::before { left: 14px; top: 15px; width: 28px; height: 28px; }
  .callout { padding: 14px 16px; font-size: 15px; }
  .sec-opinion { padding: 20px 18px; }
  table { min-width: 640px; }
  td:nth-child(2) { min-width: 240px; }
}
