/*
  똑부러지게 사는 주식투자일기: 화면 스타일 (시안 A 원고지)
  기본 틀은 blog/design/brunch.md 의 값을 그대로 쓴다.
  첫 화면: 원고지 칸에 이름을 적고 마침표만 청록. 본문: 700px 읽기 폭, 끝에 청록 마침표 하나.
*/
:root {
  --paper: #ffffff;
  --ink: #333333;
  --ink-strong: #171717;
  --ink-2: #666666;
  --ink-3: #959595;
  --line: #dddddd;
  --line-2: #eeeeee;
  --subtle: #fbfbfb;
  --teal: #00c6be;
  --teal-200: #94e6e0;
  --teal-700: #007a75;
  --warn-bg: #fff7e6;
  --warn-fg: #8a651e;

  --serif: 'Nanum Myeongjo', 'Batang', 'AppleMyungjo', serif;
  --sans: 'Noto Sans KR', 'Noto Sans DemiLight', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --ui: 'Pretendard', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, 'Noto Sans KR', 'Malgun Gothic', monospace;

  --ease: cubic-bezier(.2, 0, .2, 1);
  --wrap: 1100px;
  --reader: 700px;
  --gutter: clamp(20px, 5vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: .03em;
  word-break: keep-all;
  overflow-wrap: break-word;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
h1, h2, h3, p, ol, ul, figure, blockquote { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--teal-700); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- 초안 미리보기 띠 ---------- */
.draft-banner { background: var(--warn-bg); color: var(--warn-fg); font-family: var(--ui); font-size: 13px; line-height: 1.6; letter-spacing: 0; text-align: center; padding: 10px var(--gutter); }

/* ---------- 머리글, 바닥글 ---------- */
.site-head { border-bottom: 1px solid var(--line-2); }
.head-in { display: flex; align-items: center; min-height: 64px; }
.brand { font-family: var(--serif); font-size: 17px; letter-spacing: -.01em; color: var(--ink-strong); transition: color .2s var(--ease); }
.brand:hover { color: var(--teal-700); }
.site-foot { margin-top: 96px; padding-block: 40px 56px; border-top: 1px solid var(--line-2); font-size: 12px; line-height: 1.8; color: var(--ink-3); letter-spacing: 0; }
.site-foot p + p { margin-top: 4px; }

/* ---------- 첫 화면 ---------- */
.hero-in { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); gap: 48px; align-items: end; padding-block: 72px 56px; }
.won { font-size: 1px; line-height: 0; font-weight: 400; }
.won-grid {
  container-type: inline-size;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--teal-200); border-left: 1px solid var(--teal-200);
}
.won-grid span {
  position: relative; aspect-ratio: 1; display: grid; place-items: center;
  border-right: 1px solid var(--teal-200); border-bottom: 1px solid var(--teal-200);
  font-family: var(--serif); font-weight: 400; line-height: 1; color: var(--ink-strong);
  letter-spacing: 0;
  font-size: min(8.4vw, 56px);
  font-size: calc(100cqi / 7 * .6);
}
.won-grid span.dot::after {
  content: ""; position: absolute; left: 20%; bottom: 20%;
  width: 15%; aspect-ratio: 1; border-radius: 50%; background: var(--teal);
}
.hero-side { display: grid; gap: 12px; padding-bottom: 4px; }
.lede { font-size: 15px; line-height: 2; color: var(--ink-2); max-width: 24em; }
.by { font-size: 12px; color: var(--ink-3); letter-spacing: .02em; }
.by i { font-family: Georgia, 'PT Serif', serif; }

/* ---------- 글 목록 ---------- */
.list-wrap { padding-bottom: 8px; }
.post-item { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; padding-block: 28px; border-top: 1px solid var(--line-2); }
.date { font-family: var(--ui); font-size: 13px; letter-spacing: 0; color: var(--ink-3); font-variant-numeric: tabular-nums; line-height: 1.7; padding-top: 6px; }
.post-title { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.4; letter-spacing: -.04em; color: var(--ink-strong); margin-bottom: 8px; text-wrap: balance; }
.post-title a { transition: color .2s var(--ease); }
.post-title a:hover { color: var(--teal-700); }
.post-item .sum { max-width: 36em; font-size: 13.5px; line-height: 1.8; color: var(--ink-2); letter-spacing: .02em; margin-bottom: 8px; }
.post-item .meta { font-size: 12px; line-height: 1.6; color: var(--ink-3); letter-spacing: 0; }
.empty { padding-block: 40px; border-top: 1px solid var(--line-2); color: var(--ink-3); }

/* ---------- 본문 화면 ---------- */
.article { max-width: calc(var(--reader) + var(--gutter) * 2); margin: 0 auto; padding: 72px var(--gutter) 0; }
.article-head { margin-bottom: 56px; }
.won-row { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 26px; border-top: 1px solid var(--teal-200); border-left: 1px solid var(--teal-200); margin-bottom: 28px; }
.won-row span {
  position: relative; width: 26px; height: 26px; display: grid; place-items: center;
  border-right: 1px solid var(--teal-200); border-bottom: 1px solid var(--teal-200);
  font-family: var(--serif); font-size: 14px; line-height: 1; letter-spacing: 0; color: var(--ink-2);
}
.won-row span.pt::after { content: ""; position: absolute; left: 22%; bottom: 20%; width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); }
.won-date { display: block; }
.article-title { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 5vw, 40px); line-height: 1.4; letter-spacing: -.02em; color: var(--ink-strong); text-wrap: balance; }
.article-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 20px; font-size: 13px; line-height: 1.6; color: var(--ink-3); letter-spacing: 0; }

.prose { font-size: clamp(16px, 2.2vw, 18px); line-height: 1.95; letter-spacing: .02em; color: var(--ink); }
.prose > * + * { margin-top: 1.4em; }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 3.4vw, 28px); line-height: 1.5; letter-spacing: -.02em; color: var(--ink-strong); margin-top: 3.2em; text-wrap: balance; }
.prose h2 + * { margin-top: 1em; }
.prose h3 { font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.5; letter-spacing: -.01em; color: var(--ink-strong); margin-top: 2.4em; }
.prose p.answer { font-family: var(--serif); font-weight: 700; font-size: 1.06em; line-height: 1.8; letter-spacing: -.01em; color: var(--ink-strong); }
.prose a { color: var(--teal-700); text-decoration: underline; text-decoration-color: var(--teal-200); text-underline-offset: 4px; transition: text-decoration-color .2s var(--ease); }
.prose a:hover { text-decoration-color: var(--teal-700); }
.prose strong { font-weight: 500; color: var(--ink-strong); }
.prose .src { font-size: .8em; color: var(--ink-3); letter-spacing: .01em; }
.prose mark.todo { background: var(--warn-bg); color: var(--warn-fg); font-family: var(--ui); font-size: .8em; letter-spacing: 0; padding: 1px 8px; border-radius: 100px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--ink-3); }
.prose blockquote { padding-left: 20px; border-left: 2px solid var(--line); font-family: var(--serif); color: var(--ink-2); margin-block: 2em; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin-block: 3em; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--subtle); border: 1px solid var(--line-2); padding: 1px 6px; }
.prose pre { overflow-x: auto; background: var(--subtle); border: 1px solid var(--line-2); padding: 16px 20px; line-height: 1.7; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose figure { margin-block: 2.4em; }
.prose img { display: block; max-width: 100%; height: auto; }
.prose figcaption { margin-top: 10px; font-size: 12px; line-height: 1.7; color: var(--ink-3); letter-spacing: 0; }
.table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: .9em; line-height: 1.7; }
.prose th { font-family: var(--ui); font-weight: 500; text-align: left; color: var(--ink-strong); border-bottom: 1px solid var(--ink-3); padding: 10px 14px 10px 0; letter-spacing: 0; white-space: nowrap; }
.prose td { border-bottom: 1px solid var(--line-2); padding: 10px 14px 10px 0; vertical-align: top; }
.end-dot { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); margin-top: 3em; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.tags li { font-family: var(--ui); font-size: 13px; line-height: 1.6; letter-spacing: 0; color: var(--ink-2); background: var(--subtle); border: 1px solid var(--line-2); border-radius: 40px; padding: 4px 14px; }

.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 88px; border-top: 1px solid var(--line-2); }
.pn { display: grid; gap: 4px; padding-block: 24px; align-content: start; }
.pn.next { text-align: right; }
.pn-l { font-family: var(--ui); font-size: 12px; letter-spacing: 0; color: var(--ink-3); }
.pn-t { font-family: var(--serif); font-size: 18px; line-height: 1.5; letter-spacing: -.02em; color: var(--ink-strong); transition: color .2s var(--ease); }
a.pn:hover .pn-t { color: var(--teal-700); }
.back { margin-top: 24px; font-family: var(--ui); font-size: 13px; letter-spacing: 0; }
.back a { color: var(--teal-700); text-decoration: underline; text-decoration-color: var(--teal-200); text-underline-offset: 4px; }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 760px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-block: 40px 36px; }
  .article { padding-top: 48px; }
  .article-head { margin-bottom: 40px; }
  .site-foot { margin-top: 64px; }
}
@media (max-width: 560px) {
  .head-in { min-height: 56px; }
  .post-item { grid-template-columns: minmax(0, 1fr); gap: 4px; padding-block: 22px; }
  .date { padding-top: 0; }
  .post-title { font-size: 21px; }
  .post-nav { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 64px; }
  .pn.next { text-align: left; border-top: 1px solid var(--line-2); }
  .pn:empty { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .brand, .post-title a, .prose a, .pn-t { transition: none; }
}
