:root {
  --bg: #fafaf9;
  --panel: #ffffff;
  --hover: #f4f4f2;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --faint: #9a9aa0;
  --line: #e7e6e3;
  --accent: #a4532f;
  --link: #1c1c1e;
  --chip-bg: #f2f1ee;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113;
    --panel: #18181b;
    --hover: #1f1f23;
    --text: #e8e8ea;
    --muted: #9b9ba3;
    --faint: #6b6b73;
    --line: #2a2a2f;
    --accent: #d08b64;
    --link: #e8e8ea;
    --chip-bg: #232328;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111113;
  --panel: #18181b;
  --hover: #1f1f23;
  --text: #e8e8ea;
  --muted: #9b9ba3;
  --faint: #6b6b73;
  --line: #2a2a2f;
  --accent: #d08b64;
  --link: #e8e8ea;
  --chip-bg: #232328;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 "Inter", "Noto Sans KR", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #fff; }
main { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }

a { color: var(--link); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.mono, .lang, .name, .tag, .handle, footer, header h1, header .links a {
  font-family: "JetBrains Mono", "Noto Sans KR", ui-monospace, monospace;
}

/* language switch */
.lang { display: flex; justify-content: flex-end; gap: 14px; font-size: .75rem; }
.lang a { color: var(--faint); text-decoration: none; }
.lang a:hover { color: var(--text); }
.lang strong { color: var(--text); font-weight: 600; }

/* header with profile */
header { padding: 40px 0 0; }
.who { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.avatar {
  width: 64px; height: 64px; flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--chip-bg);
  object-fit: cover;
}
header h1 {
  margin: 0;
  font-size: 1.6rem; font-weight: 600; line-height: 1.2;
  letter-spacing: -.02em;
}
header h1 .sep { color: var(--accent); }
header h1::after {
  content: "";
  display: inline-block;
  width: .45em; height: .95em;
  margin-left: .1em;
  vertical-align: -.12em;
  background: var(--accent);
  opacity: .85;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
header .handle { margin: 2px 0 0; font-size: .8rem; color: var(--muted); }
header .handle a { color: var(--muted); }
header p { margin: 0; max-width: 62ch; color: var(--muted); }
header .links {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-width: none;
  margin-top: 16px;
  font-size: 0; /* hide the text separators between links */
}
header .links a {
  font-size: .75rem; line-height: 1;
  padding: 8px 12px;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease;
}
header .links a::after { content: " ↗"; color: var(--faint); }
header .links a:hover { border-color: var(--faint); }

/* project groups */
.tree { margin-top: 40px; }
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree > ul { display: grid; gap: 14px; }
.group > details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.group > details > summary {
  position: relative;
  padding: 16px 44px 14px 18px;
  border-bottom: 1px solid transparent;
}
.group > details[open] > summary { border-bottom-color: var(--line); }
.group > details > summary::after {
  content: "";
  position: absolute; right: 20px; top: 22px;
  width: 6px; height: 6px;
  border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.group > details:not([open]) > summary::after { transform: rotate(-45deg); }
.group > details > summary .name {
  font: 600 1rem/1.4 "Inter", "Noto Sans KR", system-ui, sans-serif;
  letter-spacing: -.005em;
}
.group > details > summary .desc { margin-top: 4px; }

.group > details > ul { padding: 6px; }
.group > details > ul > li > .node { padding: 10px 12px; border-radius: 8px; }
.node { display: block; transition: background .15s ease; }
.group .node:hover { background: var(--hover); }
.name { font-size: .85rem; font-weight: 600; color: var(--text); }
a.name { text-decoration: none; }
a.name:hover { color: var(--accent); }
.desc { display: block; margin-top: 1px; font-size: .85rem; color: var(--muted); }

/* nested children */
.group > details > ul ul {
  margin: 0 0 4px 24px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.group > details > ul ul .node { padding: 6px 10px; border-radius: 6px; }

.tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 4px;
  background: var(--chip-bg);
  color: var(--muted);
  font-size: .65rem; font-weight: 500; line-height: 1.5;
  vertical-align: 1px;
}

footer { margin-top: 48px; color: var(--faint); font-size: .75rem; }
footer::before { content: "$ "; color: var(--accent); }

@media (max-width: 560px) {
  header { padding-top: 28px; }
  .avatar { width: 56px; height: 56px; }
  header h1 { font-size: 1.35rem; }
  .group > details > summary { padding: 14px 40px 12px 14px; }
  .group > details > summary::after { right: 16px; top: 20px; }
  .group > details > ul { padding: 4px; }
  .group > details > ul ul { margin-left: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
