/* =========================================================
   kimtj.cadl.kr — style.css
   모바일 우선 / 다크모드 대응 / 외부 의존 없음

   디자인 원칙
   · 페이퍼 톤 배경 + 딥 네이비 포인트 — 차분한 신뢰감
   · 그림자 대신 헤어라인(1px 선)으로 구조를 만든다
   · 메타 정보(킥커·번호·상태)는 모노스페이스 — 엔지니어링 톤
   ========================================================= */

/* ---------- 1. 토큰 ---------- */
:root {
  --bg:            #faf9f7;
  --bg-alt:        #f3f1ed;
  --surface:       #ffffff;
  --border:        #e5e2db;
  --border-strong: #c9c4b9;
  --text:          #191c21;
  --text-mid:      #464c55;
  --text-dim:      #767d88;
  --accent:        #1c4d8f;
  --accent-soft:   #ecf1f8;
  --accent-ink:    #ffffff;
  --live:          #1a7f4b;
  --wip:           #9a6b15;

  --wrap:      68rem;
  --pad:       1.25rem;
  --radius:    10px;
  --radius-sm: 6px;

  --step-0:    1rem;
  --step-1:    1.125rem;
  --step-2:    1.5rem;
  --step-3:    2.25rem;

  --font: "Pretendard Variable", Pretendard, system-ui, -apple-system,
          "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR",
          "Malgun Gothic", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas,
          "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #0e1114;
    --bg-alt:        #13171c;
    --surface:       #161b21;
    --border:        #272d36;
    --border-strong: #3d4550;
    --text:          #e9ecef;
    --text-mid:      #adb5c0;
    --text-dim:      #7d8590;
    --accent:        #85aee0;
    --accent-soft:   #1b2431;
    --accent-ink:    #0e1114;
    --live:          #4ec98a;
    --wip:           #d3a44a;
  }
}

/* ---------- 2. 리셋 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }
blockquote { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 3. 레이아웃 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.section { padding-block: 4rem; }
.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}
.section-alt + .site-footer,
.section-alt + .section-alt { border-top: 0; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: .6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  z-index: 100;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ---------- 4. 헤더 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: .9rem;
  font-weight: 700;
}

.brand-domain {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 400;
  margin-left: .1rem;
}

.nav ul {
  display: flex;
  gap: .125rem;
}
.nav a {
  display: block;
  padding: .4rem .6rem;
  border-radius: var(--radius-sm);
  color: var(--text-mid);
  font-size: .88rem;
  font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }
.nav a[aria-current="true"] {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- 5. 히어로 ---------- */
.hero {
  position: relative;
  padding-block: 4.5rem 3.5rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

/* 은은한 도트 그리드 — 청사진 느낌, 아래로 갈수록 사라진다 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1.5px);
  background-size: 26px 26px;
  opacity: .35;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
          mask-image: linear-gradient(to bottom, #000 0%, transparent 72%);
  pointer-events: none;
}
.hero .wrap { position: relative; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .06em;
  color: var(--text-dim);
  padding: .3rem .75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.eyebrow-dot {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--live);
}

.hero-title {
  margin-top: 1.25rem;
  font-size: clamp(2.25rem, 8.5vw, 3.9rem);
  letter-spacing: -.04em;
  line-height: 1.14;
}
.hero-title em {
  font-style: normal;
  color: var(--accent);
}

.hero-lead {
  margin-top: 1.5rem;
  max-width: 37rem;
  font-size: var(--step-1);
  color: var(--text-mid);
  line-height: 1.85;
}
.hero-lead strong { color: var(--text); font-weight: 700; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .625rem;
  margin-top: 2rem;
}

/* 지표 밴드 — 숫자로 만드는 첫인상 */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 3rem;
  border-top: 1px solid var(--border);
}

.hero-stats li {
  display: grid;
  gap: .15rem;
  padding: 1.1rem .25rem 0;
}
.hero-stats li + li {
  border-left: 1px solid var(--border);
  padding-left: 1.1rem;
}

.stat-num {
  font-size: clamp(1.4rem, 4.5vw, 2rem);
  font-weight: 750;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: .8rem;
  color: var(--text-dim);
}

/* ---------- 6. 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 2.85rem;
  padding: 0 1.35rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease,
              color .15s ease, transform .1s ease;
}
.btn:hover { text-decoration: none; border-color: var(--text-mid); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  border-color: var(--accent);
  filter: brightness(1.08);
}

.btn-copy {
  min-height: 2.4rem;
  padding: 0 1rem;
  font-size: .85rem;
}

/* ---------- 7. 섹션 헤딩 ---------- */
.section-head { max-width: 44rem; }

.section-kicker {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

.kicker-no {
  color: var(--text-dim);
  font-weight: 400;
}
.kicker-no::after {
  content: "";
  display: inline-block;
  width: 1.6rem;
  height: 1px;
  background: var(--border-strong);
  vertical-align: middle;
  margin-left: .6rem;
}

.section-title {
  margin-top: .6rem;
  font-size: clamp(1.6rem, 5vw, var(--step-3));
  letter-spacing: -.03em;
}

.section-lead {
  margin-top: .8rem;
  color: var(--text-mid);
}

/* ---------- 8. About ---------- */
.about-grid {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
}

.about-body p + p { margin-top: 1.1rem; }
.about-body p { color: var(--text-mid); }
.about-body strong { color: var(--text); }

.about-quote {
  align-self: start;
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.about-quote p {
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: -.01em;
}

.about-quote footer {
  margin-top: .75rem;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-dim);
}

/* ---------- 9. Works ---------- */
.work-list {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
  counter-reset: work;
}

.work-card {
  counter-increment: work;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.4rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s ease;
}
.work-card:hover { border-color: var(--border-strong); }

.work-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

/* 카드 번호 — CSS 카운터가 자동으로 붙인다 */
.work-head::before {
  content: "0" counter(work);
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--text-dim);
  letter-spacing: .04em;
}

.work-status {
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .03em;
  padding: .18rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-mid);
}
.work-status::before {
  content: "";
  width: .42rem;
  height: .42rem;
  border-radius: 50%;
  background: currentColor;
}
.work-status.is-live { color: var(--live); border-color: color-mix(in srgb, var(--live) 35%, var(--border)); }
.work-status.is-wip  { color: var(--wip);  border-color: color-mix(in srgb, var(--wip) 35%, var(--border)); }

.work-title {
  margin-top: .85rem;
  font-size: var(--step-1);
  letter-spacing: -.015em;
}

.work-desc {
  margin-top: .55rem;
  color: var(--text-mid);
  font-size: .95rem;
  line-height: 1.75;
}

.work-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  margin-top: auto;
  padding-top: 1rem;
}
.work-tags span {
  padding: .12rem .55rem;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-dim);
  background: var(--bg-alt);
  border: 1px solid var(--border);
}

.work-note {
  margin-top: 1.5rem;
  font-size: .85rem;
  color: var(--text-dim);
}

/* ---------- 10. Links ---------- */
.link-list {
  display: grid;
  gap: .7rem;
  margin-top: 2rem;
  max-width: 44rem;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.link-card:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--accent-soft);
}
.link-card:hover .link-arrow {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.link-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: .95rem;
  color: var(--text-mid);
}

.link-text { display: grid; gap: .1rem; min-width: 0; }
.link-title { font-weight: 700; letter-spacing: -.01em; }
.link-sub { font-size: .82rem; color: var(--text-dim); }

.link-arrow {
  margin-left: auto;
  color: var(--text-dim);
  transition: transform .15s ease, color .15s ease;
}

.link-card.is-pending {
  opacity: .5;
  cursor: default;
}
.link-card.is-pending:hover {
  border-color: var(--border);
  background: var(--surface);
}
.link-card.is-pending:hover .link-arrow { transform: none; color: var(--text-dim); }

/* ---------- 11. Contact ---------- */
.contact-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.5rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 44rem;
}

.contact-mail {
  font-family: var(--mono);
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -.01em;
}
.contact-mail a { color: var(--text); }
.contact-mail a:hover { color: var(--accent); text-decoration: none; }

.contact-panel .btn-copy { margin-left: auto; }

/* ---------- 12. 푸터 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2.25rem;
  font-size: .85rem;
  color: var(--text-dim);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem;
}
.footer-note { font-family: var(--mono); font-size: .78rem; }

/* ---------- 13. 넓은 화면 ---------- */
@media (min-width: 40rem) {
  :root { --pad: 2rem; }
  .section { padding-block: 5.5rem; }
  .hero { padding-block: 6.5rem 4.5rem; }

  .hero-stats li { padding-top: 1.4rem; }

  .work-list { grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
}

@media (min-width: 60rem) {
  .about-grid {
    grid-template-columns: 1.55fr 1fr;
    gap: 3.5rem;
    align-items: start;
  }

  .work-list { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 14. Log (목록) ---------- */
.log-list {
  display: grid;
  gap: .7rem;
  margin-top: 2rem;
  max-width: 46rem;
}

.log-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.log-row:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.log-date {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--text-dim);
  letter-spacing: .02em;
}

.log-text { display: grid; gap: .15rem; min-width: 0; }
.log-title { font-weight: 700; letter-spacing: -.01em; }
.log-excerpt {
  font-size: .85rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.log-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-dim);
}

.log-empty {
  padding: 1.25rem 1.4rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: .9rem;
}

.log-more { margin-top: 1.5rem; }

/* ---------- 15. 글 본문 (log.html) ---------- */
.page-hero {
  position: relative;
  padding-block: 3.25rem 2.5rem;
  border-bottom: 1px solid var(--border);
}

.back-link {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-dim);
}
.back-link:hover { color: var(--accent); text-decoration: none; }

.post { max-width: 46rem; }

.post-date {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--text-dim);
}

.post-title {
  margin-top: .5rem;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  letter-spacing: -.03em;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .8rem;
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--text-dim);
}

.post-body { margin-top: 2rem; color: var(--text-mid); }
.post-body h2, .post-body h3, .post-body h4 {
  margin: 2.2rem 0 .7rem;
  color: var(--text);
  letter-spacing: -.02em;
}
.post-body h2 { font-size: 1.35rem; }
.post-body h3 { font-size: 1.15rem; }
.post-body h4 { font-size: 1rem; }
.post-body p { margin: .95rem 0; }
.post-body strong { color: var(--text); }
.post-body ul, .post-body ol {
  margin: .95rem 0;
  padding-left: 1.4rem;
}
.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }
.post-body li { margin: .3rem 0; }
.post-body blockquote {
  margin: 1.2rem 0;
  padding: .3rem 0 .3rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--text-mid);
}
.post-body blockquote p { margin: .3rem 0; }
.post-body code {
  font-family: var(--mono);
  font-size: .85em;
  padding: .08em .4em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.post-body pre {
  margin: 1.2rem 0;
  padding: 1rem 1.1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  line-height: 1.6;
}
.post-body pre code { padding: 0; border: 0; background: none; font-size: .85rem; }
.post-body img {
  margin: 1.2rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.post-body hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

/* ---------- 16. 타임라인 (profile.html) ---------- */
.timeline {
  position: relative;
  margin-top: 2.5rem;
  max-width: 46rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: .34rem;
  top: .5rem;
  bottom: .4rem;
  width: 1px;
  background: var(--border-strong);
}

.tl-item {
  position: relative;
  padding-left: 2.1rem;
}
.tl-item + .tl-item { margin-top: 2.4rem; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: .4rem;
  width: .72rem;
  height: .72rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.tl-item.is-now::before { background: var(--accent); }

.tl-era {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.tl-title {
  margin-top: .3rem;
  font-size: var(--step-1);
  letter-spacing: -.015em;
}

.tl-body {
  margin-top: .55rem;
  color: var(--text-mid);
  font-size: .95rem;
}
.tl-body p + p { margin-top: .6rem; }

.about-more { font-size: .95rem; }

/* ---------- 17. 인쇄 ---------- */
@media print {
  .site-header, .hero-actions, .btn, .back-link { display: none; }
  body { background: #fff; color: #000; }
  .hero::before { display: none; }
}
