:root {
  color-scheme: light dark;
  --bg: #fafaf8;
  --ink: #171717;
  --muted: #62625e;
  --line: #d8d8d2;
  --accent: #0CCCCC;
  --link-hover: #006b6b;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --ink: #ecece8;
    --muted: #a3a39c;
    --line: #2f2f2c;
    --link-hover: var(--accent);
  }
}

* { box-sizing: border-box; }

html {
  font-size: 106.25%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-synthesis: none;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  padding: 10px 14px;
  color: var(--bg);
  background: var(--ink);
  z-index: 10;
}

.skip:focus { top: 16px; }

.shell {
  width: min(1040px, calc(100% - 64px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

/* header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 200px;
  height: 72px;
  overflow: hidden;
}

.brand img {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 200px;
  height: auto;
  transform: translate(-50%, -50%);
}

@media (prefers-color-scheme: dark) {
  .brand img { width: 245px; }
}

.lang {
  color: var(--muted);
  font-weight: 560;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.lang:hover { color: var(--link-hover); }

/* hero */

.hero { margin-top: clamp(84px, 14vw, 156px); }

.hero h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.7rem, 7.2vw, 5.2rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.055em;
}

.hero .intro {
  max-width: 36em;
  margin: 28px 0 0;
  color: var(--muted);
}

.hero .count {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 28px 0 0;
  font-size: 1.25rem;
  font-weight: 620;
}

.hero .count small {
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
}

/* projects */

.projects { margin-top: clamp(72px, 11vw, 128px); }

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.filters[hidden] { display: none; }

.filters button {
  min-height: 44px;
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 620;
  cursor: pointer;
}

.filters button:hover { color: var(--ink); }

.filters button[aria-pressed="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.archive-filter {
  display: flex;
  align-items: center;
  gap: 22px;
}

.filter-separator {
  color: var(--muted);
}

.list {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr) 9rem;
  gap: 8px 36px;
  align-items: start;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.project[hidden] { display: none; }

.p-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 680;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.project[data-archived="true"] .p-name { color: var(--muted); }

.p-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 8px 0 0;
}

.category-tag,
.archive-tag {
  display: inline-block;
  color: var(--muted);
  font-size: 1rem;
}

.p-sum { margin: 0; }

.p-updated { display: inline-flex; overflow: hidden; margin: 8px 0 0; border-radius: 3px; line-height: 1.5; }
.p-updated span { padding: 0 6px; color: #fff; background: #555; }
.p-updated time { padding: 0 6px; color: #111; background: #0ccccc; }
.p-updated[hidden] { display: none; }

.p-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.p-links a {
  display: inline-block;
  min-height: 32px;
  font-weight: 620;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.p-links a:hover { color: var(--link-hover); }

/* about + contact */

.about,
.contact { margin-top: clamp(72px, 11vw, 120px); }

.about p,
.contact p {
  max-width: 36em;
  margin: 18px 0 0;
}

.contact ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.contact a {
  font-weight: 620;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.contact a:hover { color: var(--link-hover); }

footer {
  margin-top: clamp(80px, 12vw, 140px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

footer p { margin: 0; }

/* 404 */

.notfound { margin-top: clamp(84px, 14vw, 156px); }
.notfound h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.05em; line-height: 1.1; }
.notfound p { margin: 20px 0 0; color: var(--muted); }
.notfound a { font-weight: 620; }

@media (max-width: 860px) {
  .project { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .p-links { flex-direction: row; gap: 22px; }
}

@media (max-width: 720px) {
  .shell { width: calc(100% - 36px); padding-top: 22px; }
  .hero h1 { max-width: 9ch; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
