/*
  VOICE: 담백하고 자신감 있는 개인 페이지, 말은 짧게
  IDEA: 도메인 트리 — 모든 작업이 minchan.app 아래 서브도메인으로 뻗어 있음
  PICTURE: minchan.app 루트에서 프로젝트 서브도메인으로 갈라지는 가지
  COLOUR and TYPE: 흰 바탕/먹색, 강조 하나(노랑 #FFC340), Space Grotesk + IBM Plex Sans KR
  LAYOUT: 이름 → 트리 → 프로젝트 목록 → 스택 → 연락처, 한 컬럼
*/
:root {
  color-scheme: light dark;
  --bg: light-dark(#ffffff, #111214);
  --ink: light-dark(#141414, #f1f1ef);
  --sub: light-dark(#5f6166, #a4a6ab);
  --line: light-dark(#e4e4e1, #2a2c30);
  --soft: light-dark(#f5f5f2, #1a1b1e);
  --accent: #ffc340;
  --on-accent: #141414;
}
:root[data-theme=light] { color-scheme: light; }
:root[data-theme=dark] { color-scheme: dark; }
* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "IBM Plex Sans KR", system-ui, sans-serif;
  overflow-x: clip;
}
a { color: inherit; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 max(5vw, 18px); }

nav { display: flex; justify-content: space-between; align-items: center; padding: 22px 0; gap: 16px; flex-wrap: wrap; }
.logo { font: 700 18px "Space Grotesk", sans-serif; text-decoration: none; }
.logo b { color: var(--accent); }
nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
nav ul a { display: inline-block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--sub); font-size: 15px; }
nav ul a:hover, nav ul a:focus-visible { color: var(--ink); background: var(--soft); }

.hero { padding: clamp(40px, 8vw, 96px) 0 clamp(28px, 5vw, 48px); }
.id { display: flex; align-items: center; gap: clamp(16px, 3vw, 28px); margin: 0 0 24px; }
.avatar { display: block; width: clamp(84px, 16vw, 136px); aspect-ratio: 1 / 1; flex: none; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 4px var(--accent); }
.avatar svg { display: block; width: 100%; height: 100%; shape-rendering: crispEdges; }
.eye { transform-box: fill-box; transform-origin: center; animation: blink 4.8s infinite; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.08); } }
h1 { margin: 0; display: grid; gap: 6px; }
h1 { --ko: clamp(40px, 8vw, 76px); }
h1 .ko { font: 700 var(--ko)/1.02 "IBM Plex Sans KR", sans-serif; letter-spacing: -0.02em; }
h1 .en { font: 500 clamp(18px, 3vw, 26px)/1.2 "Space Grotesk", sans-serif; color: var(--sub); padding-left: calc(var(--ko) * 0.06); }
.lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--sub); max-width: 34em; margin: 0; text-wrap: balance; }
.lead strong { color: var(--ink); font-weight: 500; }

/* 도메인 트리 */
.tree { margin: clamp(36px, 6vw, 64px) 0 0; }
.root {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 20px "Space Grotesk", sans-serif;
  background: var(--ink); color: var(--bg);
  padding: 12px 20px; border-radius: 999px;
}
.root i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.branches { list-style: none; margin: 0; padding: 26px 0 0 24px; border-left: 2px solid var(--line); margin-left: 28px; display: grid; gap: 10px; }
.branches li { position: relative; }
.branches li::before { content: ""; position: absolute; left: -24px; top: 50%; width: 18px; border-top: 2px solid var(--line); }
.branches a {
  display: inline-flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; border-radius: 12px; text-decoration: none;
  background: var(--soft); transition: transform .2s ease, background .2s ease;
}
.branches a:hover, .branches a:focus-visible { background: var(--accent); color: var(--on-accent); transform: translateX(6px); }
.branches a:hover .host span, .branches a:focus-visible .host span { color: var(--on-accent); }
.host { font: 500 17px "Space Grotesk", sans-serif; }
.host span { color: var(--sub); }
.branches small { font-size: 14px; opacity: .8; }

section { padding: clamp(40px, 7vw, 80px) 0; border-top: 1px solid var(--line); }
h2 { font: 700 clamp(28px, 4vw, 36px)/1.1 "Space Grotesk", "IBM Plex Sans KR", sans-serif; margin: 0 0 28px; }

.proj { list-style: none; margin: 0; padding: 0; }
.proj li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.proj li:last-child { border-bottom: 0; }
.proj h3 { margin: 0; font-size: 19px; font-weight: 700; }
.proj p { margin: 4px 0 10px; color: var(--sub); max-width: 40em; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tags span { font-size: 13px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--sub); }
.proj .go { align-self: start; font: 500 15px "Space Grotesk", sans-serif; white-space: nowrap; padding: 4px 2px; text-decoration: none; box-shadow: inset 0 -8px 0 var(--accent); }
.proj .go:hover { box-shadow: inset 0 -1.4em 0 var(--accent); color: var(--on-accent); }
.more { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 20px; padding: 0 20px; border-radius: 999px; background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 700; }
.more:hover, .more:focus-visible { background: var(--ink); color: var(--bg); }
.page-head { padding: clamp(40px, 8vw, 88px) 0 clamp(20px, 4vw, 32px); }
.page-head h1 { font: 700 clamp(36px, 7vw, 60px)/1.05 "IBM Plex Sans KR", sans-serif; letter-spacing: -0.02em; }
.page-head p { color: var(--sub); margin: 12px 0 0; }
.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--sub); text-decoration: none; }
.back:hover { color: var(--ink); }

.stack { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 28px; }
.stack h3 { margin: 0 0 8px; font-size: 15px; color: var(--sub); font-weight: 500; }
.stack p { margin: 0; font-size: 17px; }

.contact p { color: var(--sub); margin: 0 0 24px; }
.mail {
  display: inline-block; font: 700 clamp(24px, 5vw, 40px)/1.2 "Space Grotesk", sans-serif;
  text-decoration: none; border-bottom: 3px solid var(--accent); overflow-wrap: anywhere;
}
.links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--soft); text-decoration: none; font-weight: 500; }
.links a:hover, .links a:focus-visible { background: var(--ink); color: var(--bg); }
.copy { font: inherit; font-size: 14px; margin-left: 12px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--ink); cursor: pointer; vertical-align: middle; }
.copy:hover { border-color: var(--ink); }

footer { padding: 32px 0 48px; color: var(--sub); font-size: 14px; border-top: 1px solid var(--line); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 600px) {
  .proj li { grid-template-columns: minmax(0, 1fr); }
  .branches { margin-left: 16px; padding-left: 18px; }
  .branches li::before { left: -18px; width: 12px; }
  .copy { margin: 12px 0 0; display: block; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .branches a { transition: none; }
  .branches a:hover { transform: none; }
}

/* 섹션 공통 */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.sec-head h2 { margin: 0; }
.sec-lead { color: var(--sub); margin: -16px 0 28px; }
.scroll { overflow-x: auto; }

/* GitHub 잔디 */
.sub-link { font: 500 16px "Space Grotesk", "IBM Plex Sans KR", sans-serif; color: var(--sub); text-decoration: none; }
.sub-link:hover { color: var(--ink); }
.gh-total { margin: -12px 0 18px; font-size: 17px; }
.grass-wrap { padding-bottom: 8px; }
.grass { --cell: 12px; display: grid; grid-template-rows: repeat(7, var(--cell)); grid-auto-flow: column; grid-auto-columns: var(--cell); gap: 3px; width: max-content; }
.grass i, .grass-legend i { display: block; width: var(--cell, 12px); height: var(--cell, 12px); border-radius: 3px; }
.l0 { background: var(--line); }
.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--soft)); }
.l2 { background: color-mix(in srgb, var(--accent) 55%, var(--soft)); }
.l3 { background: color-mix(in srgb, var(--accent) 80%, var(--soft)); }
.l4 { background: var(--accent); }
.grass .pad { visibility: hidden; }
.grass-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 10px; font-size: 13px; color: var(--sub); }
.grass-legend i { --cell: 11px; }

/* 홈랩 */
.lab { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.box { background: var(--soft); border-radius: 18px; padding: 24px; }
.box h3 { margin: 0; font-size: 21px; }
.box .os { margin: 2px 0 18px; color: var(--sub); font: 500 15px "Space Grotesk", sans-serif; }
.box dl { margin: 0; display: grid; gap: 8px; }
.box dl div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.box dt { color: var(--sub); }
.box dd { margin: 0; font-weight: 500; text-align: right; }
.box .runs { margin: 16px 0 0; font-size: 15px; }
.box .runs::before { content: "돌리는 것 "; color: var(--sub); }

/* 프로젝트 페이지 (스크린샷) */
.proj.full li { grid-template-columns: 220px minmax(0, 1fr) auto; align-items: start; }
.shot { display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--soft); border: 1px solid var(--line); text-decoration: none; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot span { font: 700 22px "Space Grotesk", sans-serif; color: var(--sub); }
.proj.full li:hover .shot { border-color: var(--accent); }
@media (max-width: 720px) {
  .proj.full li { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .eye { animation: none; }
}

nav ul a[aria-current=page] { color: var(--ink); font-weight: 700; }

/* 소개 + 숫자 */
.about { margin: 20px 0 0; max-width: 36em; }
.about p { margin: 0 0 4px; }
.stats { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 40px; }
.stats li { display: grid; }
.stats b { font: 700 clamp(32px, 5vw, 44px)/1 "Space Grotesk", sans-serif; }
.stats b small { font: 500 18px "IBM Plex Sans KR", sans-serif; margin-left: 2px; color: var(--sub); }
.stats span { font-size: 14px; color: var(--sub); margin-top: 6px; }

/* 프로젝트 링크 */
.plink { text-decoration: none; }
.plink:hover { box-shadow: inset 0 -0.4em 0 var(--accent); }
.nolink { align-self: start; font-size: 14px; color: var(--sub); white-space: nowrap; padding: 4px 0; }

/* 활동 */
.acts { list-style: none; margin: 0; padding: 0; }
.acts li { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 4px 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.acts li:last-child { border-bottom: 0; }
.acts .when { margin: 0; display: grid; align-content: start; }
.acts time { font: 700 26px/1.15 "Space Grotesk", sans-serif; white-space: nowrap; }
.acts .when small { font: 500 15px/1.4 "Space Grotesk", sans-serif; color: var(--sub); margin-top: 4px; white-space: nowrap; }
.acts h3 { margin: 0; font-size: 19px; }
.acts .place { margin: 2px 0 0; color: var(--sub); font-size: 14px; }
.acts p { margin: 0; max-width: 40em; }
.acts h3 + p:not(.place), .acts .place + p { margin-top: 8px; }
.acts h3 { margin-top: 2px; }

/* 기록 */
.note-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.note-list a { display: block; height: 100%; padding: 22px; border-radius: 18px; background: var(--soft); text-decoration: none; transition: background .2s ease; }
.note-list a:hover, .note-list a:focus-visible { background: color-mix(in srgb, var(--accent) 35%, var(--soft)); }
.note-list h3, .note-list h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.35; }
.note-list p { margin: 0; color: var(--sub); font-size: 15px; }
.note-list time { display: block; margin-top: 12px; font-size: 13px; color: var(--sub); }
.note-list.big { grid-template-columns: minmax(0, 1fr); }
.note-list.big h2 { font-size: 21px; }

/* 상세 페이지 */
.page-head .tags { margin-top: 16px; }
.page-head .more, .page-head .nolink { margin-top: 20px; display: inline-flex; }
.prose { max-width: 40em; padding-bottom: clamp(24px, 5vw, 48px); }
.prose h2 { font-size: 22px; margin: 36px 0 10px; }
.prose h2:first-child { margin-top: 8px; }
.prose p { margin: 0 0 16px; font-size: 17px; line-height: 1.75; }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 28px 0 48px; border-top: 1px solid var(--line); }
.pager a { display: grid; gap: 2px; padding: 16px 18px; border-radius: 14px; background: var(--soft); text-decoration: none; font-weight: 700; }
.pager a.next { text-align: right; }
.pager a:hover { background: color-mix(in srgb, var(--accent) 35%, var(--soft)); }
.pager small { font-weight: 400; color: var(--sub); font-size: 13px; }
@media (max-width: 600px) {
  .acts li { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .note-list a { transition: none; }
}

.hero-shot { margin: 0 0 32px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--soft); max-width: 900px; }
.hero-shot img { display: block; width: 100%; height: auto; }
