:root {
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #5a6672;
  --rule: #e4e9ee;
  --land: #eef2f5;
  --ring: #7ea6cc;
  --accent: #c0157a;
  --accent-soft: rgba(192, 21, 122, 0.08);
  --focus: #2f6fb0;

  /* 도구별 색면: 바탕 / 그림 선 / 글자 (글자는 바탕 위 대비 4.5:1 이상) */
  --sky: #e4f1ff;   --sky-line: #2f80e4;   --sky-ink: #1b5aa6;
  --lamp: #fff4c7;  --lamp-line: #e2a400;  --lamp-ink: #835c00;
  --mint: #dcf5e9;  --mint-line: #1fa36d;  --mint-ink: #126b46;
  --dusk: #ffe7dc;  --dusk-line: #f0663c;  --dusk-ink: #ac3c17;

  --display: 'Barlow Condensed', 'IBM Plex Sans KR', system-ui, sans-serif;
  --body: 'IBM Plex Sans KR', system-ui, -apple-system, sans-serif;

  color-scheme: light; /* 다크 모드에서도 밝은 화면 유지 */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.65;
  word-break: keep-all; /* 한국어를 단어 단위로 줄바꿈 */
  overflow-wrap: break-word;
}

a { color: inherit; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* 언어: 고른 언어의 블록만 보임 (자바스크립트가 꺼져 있으면 한국어) */
html[data-lang="ko"] body [lang="en"],
html[data-lang="en"] body [lang="ko"],
html:not([data-lang]) body [lang="en"] { display: none !important; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* ---------- 상단 ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.01em;
  line-height: 1;
}

.brand:hover { color: inherit; }
.brand img { width: 26px; height: 26px; }

.lang { display: flex; gap: 2px; }

.lang button {
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.lang button[aria-pressed="true"] { color: var(--ink); background: var(--land); }

/* ---------- 첫 화면 ---------- */

.hero { padding: 56px 0 64px; }

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6.4vw, 54px);
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.025em;
  max-width: 15em;
}

.hero p {
  margin: 20px 0 0;
  max-width: 34em;
  color: var(--muted);
  font-size: 17px;
}

/* ---------- 섹션 ---------- */

.section { padding: 8px 0 56px; }

.section h2 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
}

/* 만든 것: 2열 카드, 위에 작은 그림 */
.works {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.work { --tile: var(--land); --tile-line: var(--accent); --tile-ink: var(--accent); }
.work.sky  { --tile: var(--sky);  --tile-line: var(--sky-line);  --tile-ink: var(--sky-ink); }
.work.lamp { --tile: var(--lamp); --tile-line: var(--lamp-line); --tile-ink: var(--lamp-ink); }
.work.mint { --tile: var(--mint); --tile-line: var(--mint-line); --tile-ink: var(--mint-ink); }
.work.dusk { --tile: var(--dusk); --tile-line: var(--dusk-line); --tile-ink: var(--dusk-ink); }

.work a {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px 24px 22px;
  text-decoration: none;
  background: var(--tile);
  border: 2px solid transparent;
  border-radius: 20px;
  transition: border-color 0.15s;
}

.work a:hover { color: inherit; border-color: var(--tile-line); }

.work-art { width: 100%; height: auto; display: block; margin: 0 0 14px; }
.work-art .ring { fill: none; stroke: var(--tile-line); stroke-width: 1; opacity: 0.45; }
.work-art .ring.dash { stroke-dasharray: 2 3; }
.work-art .route { fill: none; stroke: var(--tile-line); stroke-width: 2.4; stroke-linecap: round; }
.work-art .pin { fill: var(--tile-line); }
.work-art .origin { fill: #fff; stroke: var(--tile-line); stroke-width: 2; }
.work-art .track { fill: none; stroke: #fff; stroke-width: 7; }
.work-art .progress { fill: none; stroke: var(--tile-line); stroke-width: 7; stroke-linecap: round; }
.work-art .hand { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.work-art .bar { fill: #fff; }
.work-art .bar.on { fill: var(--tile-line); }
.work-art .bar.dim { fill: var(--tile-line); opacity: 0.3; }
.work-art .track-box { fill: #fff; stroke: var(--ink); stroke-width: 2; opacity: 0.85; }
.work-art .cap { fill: var(--ink); opacity: 0.85; }
.work-art .fill { fill: var(--tile-line); }

.work-name {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
}

.work-name .alt { color: var(--tile-ink); font-weight: 500; }

.work-desc { margin: 8px 0 0; color: #3e4a55; font-size: 15px; }

.work-url { margin: auto 0 0; padding-top: 14px; font-size: 13px; font-weight: 500; color: var(--tile-ink); }

.next-note { margin: 14px 2px 0; font-size: 14px; color: var(--muted); }

/* 노트 목록 */
.notes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }

.notes a {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 24px;
  padding: 18px 2px;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.notes .title { font-size: 18px; font-weight: 500; }
.notes .summary { grid-column: 1; color: var(--muted); font-size: 15px; }
.notes time { grid-row: 1; grid-column: 2; color: var(--muted); font-size: 13px; white-space: nowrap; padding-top: 4px; }
.notes a:hover .title { color: var(--accent); }

/* ---------- 글 페이지 ---------- */

.article { padding: 32px 0 56px; }

.article .back { font-size: 14px; color: var(--muted); text-decoration: none; }

.article h1 {
  margin: 24px 0 8px;
  font-size: clamp(30px, 5.4vw, 42px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 600;
}

.article .meta { margin: 0 0 32px; color: var(--muted); font-size: 14px; }

.article .body { font-size: 17px; line-height: 1.8; max-width: 36em; }
.article .body p { margin: 0 0 1.1em; }
.article .body h2 { font-size: 20px; margin: 2em 0 0.6em; line-height: 1.4; }
.article .body ul, .article .body ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.article .body li { margin: 0 0 0.4em; }

.article .figure {
  --fig: var(--sky); --fig-ink: var(--sky-ink);
  margin: 1.6em 0;
  padding: 20px 24px;
  background: var(--fig);
  border: 0;
  border-radius: 16px;
}

/* 노트가 다루는 도구 색에 맞춘 표 바탕 */
.article .figure.lamp { --fig: var(--lamp); --fig-ink: var(--lamp-ink); }
.article .figure.mint { --fig: var(--mint); --fig-ink: var(--mint-ink); }
.article .figure.dusk { --fig: var(--dusk); --fig-ink: var(--dusk-ink); }

.article .figure table { width: 100%; border-collapse: collapse; font-size: 15px; }
.article .figure th, .article .figure td { text-align: left; padding: 8px 8px 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--fig-ink) 15%, transparent); }
.article .figure th { color: var(--fig-ink); font-weight: 500; font-size: 13px; }
.article .figure tr:last-child td { border-bottom: 0; }
.article .figure .num { font-family: var(--display); font-size: 19px; font-weight: 500; }
.article .figure figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }

.cta {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

.cta:hover { color: #fff; filter: brightness(1.08); }

/* ---------- 하단 ---------- */

.foot {
  border-top: 1px solid var(--rule);
  padding: 24px 0 48px;
  font-size: 14px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.foot nav { display: flex; gap: 20px; }
.foot a { text-decoration: none; }

@media (max-width: 560px) {
  .hero { padding: 32px 0 48px; }
  .works { grid-template-columns: 1fr; }
  .notes a { grid-template-columns: 1fr; }
  .notes time { grid-row: auto; grid-column: 1; padding-top: 0; }
  .article .figure { padding: 16px; }
  .article .figure table { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
