@import url("fonts/pretendard/pretendardvariable-dynamic-subset.css");

:root {
  color-scheme: light;

  --ink: #141414;
  --ink-soft: #262626;
  --muted: #707070;
  --faint: #adadad;
  --canvas: #ffffff;
  --canvas-soft: #f3f3f3;
  --hairline-soft: #f0f0f0;
  --hairline: #e0e0e0;

  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-full: 9999px;

  --weight-light: 300;
  --weight-text: 456;
  --weight-strong: 600;
  --weight-heading: 652;

  --leading-heading: 1;
  --leading-prose: 1.5;

  --page-width: 760px;
  --page-gutter: 20px;
  --section-gap: 80px;
}
/* 한글은 글자가 줄 높이를 꽉 채워서, 라틴 글자 기준 줄 간격으로는 줄이 서로 붙는다. */
:lang(ko) {
  --leading-heading: 1.15;
  --leading-prose: 1.65;
}
@media (max-width: 640px) {
  :root { --section-gap: 56px; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  margin: 0;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: var(--weight-text);
  line-height: 1.38;
  word-break: keep-all;
  overflow-wrap: anywhere;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
.top, main, footer > div {
  width: min(100% - 2 * var(--page-gutter), var(--page-width));
  margin-inline: auto;
}
main { flex: 1; }

a {
  color: inherit;
  text-decoration-color: var(--faint);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
strong { font-weight: var(--weight-strong); }
code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--canvas-soft);
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .875em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

h1, h2 { font-weight: var(--weight-heading); }
h1 {
  margin: var(--section-gap) 0 0;
  font-size: clamp(2.5rem, 9vw, 3.5rem);
  line-height: var(--leading-heading);
  text-wrap: balance;
}
h1 .alt { display: inline-block; font-weight: var(--weight-light); color: var(--muted); }
h2 { margin: var(--section-gap) 0 24px; font-size: 1.5rem; line-height: 1.25; }
p { margin: 12px 0 0; }

.top { display: flex; gap: 8px; padding-top: 24px; }
.top .lang { margin-left: auto; }
.top a, .contact a, .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  background: var(--canvas-soft);
  font-weight: var(--weight-strong);
  text-decoration: none;
}
.top a:hover, .contact a:hover { background: var(--hairline); }
.contact a[href^="mailto:"], .button { background: var(--ink); color: var(--canvas); }
.button { margin-top: 20px; }
.contact a[href^="mailto:"]:hover, .button:hover { background: var(--ink-soft); }
.contact a[target="_blank"]::after, footer a[target="_blank"]::after { content: "↗"; }

header h1 { font-size: clamp(3rem, 13vw, 5rem); }
.contact { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 0; padding: 0; list-style: none; }

.kind {
  width: fit-content;
  margin-top: 16px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--canvas-soft);
  font-size: .75rem;
  font-weight: var(--weight-strong);
  line-height: 1.33;
}
header .kind, .lead {
  width: auto;
  padding: 0;
  background: none;
  font-size: 1.25rem;
  font-weight: var(--weight-light);
  line-height: 1.38;
}
.lead { margin-top: 32px; }

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.projects a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  padding: 24px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  text-decoration: none;
}
.projects a:hover { border-color: var(--ink); }
.projects h2 { margin: 0; font-size: 1.25rem; font-weight: var(--weight-strong); line-height: 1.3; }
.projects .kind { margin-top: 8px; }
.projects p:last-child { margin-top: 16px; color: var(--muted); }

.features { margin: 24px 0 0; padding: 0; list-style: none; }
.features li { padding: 16px 0; border-top: 1px solid var(--hairline-soft); line-height: var(--leading-prose); }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 0; }
.facts dt, .facts dd { margin: 0; padding: 16px 0; border-top: 1px solid var(--hairline-soft); }
.facts dt { padding-right: 32px; color: var(--muted); }

.list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
h1 + .list { margin-top: 32px; }
.list a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  background: var(--canvas-soft);
  text-decoration: none;
}
.list a:hover { background: var(--hairline); }
.list a::after, summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(-45deg);
}
.list a[target="_blank"]::after { content: "↗"; width: auto; height: auto; border: 0; font-weight: var(--weight-strong); transform: none; }
.list .text { display: flex; flex-direction: column; gap: 2px; }
.list .title { font-weight: var(--weight-strong); }
.list .desc { font-size: .875rem; line-height: 1.43; }

.doc h1 { font-size: clamp(2rem, 7vw, 2.75rem); }
.doc h2 { margin: 48px 0 16px; }
.doc h1 + p { margin-top: 24px; }
.doc p, .doc li { line-height: var(--leading-prose); }
.doc ul, .doc ol { margin: 12px 0 0; padding-left: 1.25rem; }
.doc li { margin-top: 6px; }
.doc ul > li::marker { color: var(--faint); }
.doc ol > li::marker { font-weight: var(--weight-strong); }
.doc h1 + .meta { margin-top: 12px; color: var(--muted); font-size: .875rem; line-height: 1.43; }
.meta + p { margin-top: 24px; }

table {
  width: 100%;
  margin-top: 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  border-spacing: 0;
  overflow: hidden;
  font-size: .875rem;
  line-height: 1.5;
}
/* body의 anywhere는 칸의 최소 너비를 글자 하나로 만들어서, 짧은 열이 글자마다 줄바꿈된다. */
th, td { padding: 12px 16px; text-align: left; vertical-align: top; overflow-wrap: break-word; }
th { font-weight: var(--weight-strong); }
/* 칸마다 배경을 칠하면 칸 사이에 틈이 보여서 줄에 칠한다. */
tr:has(th) { background: var(--canvas-soft); }
th:first-child, td:first-child { min-width: 8em; }
td { border-top: 1px solid var(--hairline); }

details { margin-top: 12px; border-radius: var(--radius-sm); background: var(--canvas-soft); }
summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  list-style: none;
}
summary::-webkit-details-marker { display: none; }
summary::after { transform: rotate(45deg); }
details[open] summary::after { transform: rotate(-135deg); }
details p { margin: 0; padding: 0 24px 16px; }

footer {
  margin-top: 120px;
  padding: 80px 0 48px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--ink);
  color: var(--canvas);
}
footer > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px 24px; }
footer .wordmark {
  flex-basis: 100%;
  font-size: clamp(3rem, 13vw, 5rem);
  font-weight: var(--weight-heading);
  line-height: var(--leading-heading);
}
footer p { margin: 0; color: var(--faint); }
footer a { display: inline-flex; gap: 6px; font-weight: var(--weight-strong); text-decoration: none; }
footer :focus-visible { outline-color: var(--canvas); }

@media (prefers-reduced-motion: no-preference) {
  .top a, .contact a, .button, .list a { transition: background-color .15s; }
  .projects a { transition: border-color .15s; }
  summary::after { transition: transform .15s; }
}
