:root {
  --bg: #fbf9f7; --card: #ffffff; --text: #221d1b; --muted: #7a6f6a; --line: #ebe3df;
  --accent: #b5473f; --accent-soft: #fbe9e6; --code-bg: #f3eeeb; --btn-text: #fff;
  --danger: #b5473f; --danger-soft: #fbe9e6; --ok: #2f7d4f; --ok-soft: #e3f4ea; --blue: #2f5fa8; --blue-soft: #e4ecf9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161211; --card: #1f1917; --text: #f1eae6; --muted: #a0938d; --line: #2f2624;
    --accent: #e98b82; --accent-soft: #3a2320; --code-bg: #2a2220; --btn-text: #161211;
    --danger: #f08a82; --danger-soft: #3d1f1c; --ok: #7bd39c; --ok-soft: #1f3a2a; --blue: #8fb3f0; --blue-soft: #1f2c44;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Roboto", sans-serif; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---- header / footer ---- */
.site { border-bottom: 1px solid var(--line); background: var(--card); }
.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; padding-top: max(14px, env(safe-area-inset-top)); flex-wrap: wrap; }
.site .brand { font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: -0.01em; }
.site nav { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.site nav a { color: var(--muted); }
.site nav a:hover { color: var(--accent); text-decoration: none; }
.search input { font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--text); width: 110px; transition: width .15s; }
.search input:focus { outline: 2px solid var(--accent); border-color: transparent; width: 160px; }
.site-foot { border-top: 1px solid var(--line); margin-top: 60px; padding: 24px 0 40px; color: var(--muted); font-size: 13px; }
.site-foot a { color: var(--muted); }

/* ---- list ---- */
main.wrap { padding-top: 28px; }
.tagline { color: var(--muted); font-size: 16px; margin: 0 0 22px; }
.listhead { font-size: 22px; margin: 0 0 18px; }
.empty { color: var(--muted); text-align: center; padding: 50px 0; }
.posts { display: flex; flex-direction: column; gap: 22px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.card .cover { display: block; aspect-ratio: 2 / 1; overflow: hidden; background: var(--code-bg); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.card:hover .cover img { transform: scale(1.02); }
.card .body { padding: 18px 20px 16px; }
.card h2 { margin: 0 0 6px; font-size: 21px; line-height: 1.35; letter-spacing: -0.01em; }
.card h2 a { color: var(--text); }
.card .excerpt { margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.meta { margin: 0; font-size: 13px; color: var(--muted); }
.meta .tag { margin-left: 6px; }
.draft { background: var(--accent-soft); color: var(--accent); padding: 1px 8px; border-radius: 999px; font-size: 12px; margin-left: 6px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin: 30px 0 0; font-size: 15px; }
.tagcloud { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 14px; }
.tagcloud span { color: var(--muted); font-size: 12px; }

/* ---- post ---- */
.post header h1 { font-size: 30px; line-height: 1.3; margin: 0 0 8px; letter-spacing: -0.02em; }
.post header .meta { margin-bottom: 22px; }
.post .hero { margin: 0 0 26px; }
.post .hero img { width: 100%; border-radius: 16px; display: block; }
.content { font-size: 17px; line-height: 1.85; }
.content > *:first-child { margin-top: 0; }
.content p { margin: 0 0 1.2em; }
.content h2 { font-size: 23px; margin: 2em 0 .6em; letter-spacing: -0.01em; }
.content h3 { font-size: 19px; margin: 1.6em 0 .5em; }
.content img { display: block; margin: 1.4em auto; border-radius: 12px; }
.content blockquote { margin: 1.4em 0; padding: .2em 0 .2em 1.1em; border-left: 3px solid var(--accent); color: var(--muted); }
.content blockquote p { margin: .4em 0; }
.content pre { background: var(--code-bg); padding: 14px 16px; border-radius: 12px; overflow: auto; font-size: 14px; line-height: 1.5; }
.content code { background: var(--code-bg); padding: 2px 6px; border-radius: 6px; font-size: .92em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.content pre code { background: none; padding: 0; }
.content table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 1.2em 0; }
.content th, .content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.content ul, .content ol { padding-left: 1.4em; }
.content .embed { position: relative; padding-top: 56.25%; margin: 1.4em 0; border-radius: 12px; overflow: hidden; background: #000; }
.content .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ad { margin: 26px 0; min-height: 0; text-align: center; }
.ad:empty { display: none; }
.neighbors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 44px; }
.neighbors .n { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font-size: 15px; line-height: 1.4; }
.neighbors .n .k { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.neighbors .prev { text-align: right; grid-column: 2; }
.neighbors .next { grid-column: 1; }
.neighbors .n:hover { border-color: var(--accent); text-decoration: none; }
@media (max-width: 480px) { .post header h1 { font-size: 25px; } .content { font-size: 16px; } .neighbors { grid-template-columns: 1fr; } .neighbors .prev, .neighbors .next { grid-column: auto; text-align: left; } }
