/* ==========================================================================
   Tokens
   밝은 면(paper)은 에디토리얼 본문용, 어두운 면은 DESIGN.md의 표면 계조를 그대로 쓴다.
   민트 강조색(#3ce8a0)은 어두운 면에서만 채움·텍스트로 쓰고,
   밝은 면에서는 대비를 맞춘 짙은 민트(--accent-ink, 5.5:1)만 쓴다.
   ========================================================================== */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 100 800;
  src: url(../fonts/jetbrains-mono/jetbrains-mono-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f3f3ef;
  --paper-2: #e9e9e3;
  --ink: #0e0e0e;
  --ink-2: #55554f;
  --ink-3: #6b6b65;
  --rule: #d6d6cf;
  --accent-ink: #00704a;

  --bg: #0a0a0a;
  --surface-1: #141414;
  --surface-2: #1c1c1c;
  --surface-3: #262626;
  --border: #262629;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text-1: #f2f2f2;
  --text-2: #a1a1a1;
  --text-3: #8a8a8a;
  --accent: #3ce8a0;
  --accent-hover: #5ef0b3;
  --on-accent: #0a0a0a;
  --accent-bg: rgba(60, 232, 160, 0.12);
  --focus-ring: 0 0 0 3px rgba(60, 232, 160, 0.35);

  --heat-0: #1c1c1c;
  --heat-1: #1d4535;
  --heat-2: #237052;
  --heat-3: #2ea878;
  --heat-4: #3ce8a0;

  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(20px, 4.2vw, 60px);
  --max: 1320px;
  --section-y: clamp(88px, 11vw, 168px);
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss06';
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 4px;
}
.dark :focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: absolute;
  left: 12px; top: -48px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-md);
  text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.num { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 243, 239, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 60px;
}
/* 헤더 워드마크: 활동명 "gerard"를 모노 소문자로. 이름은 Hero에만 둔다. */
.brand {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}
.brand-dot { color: var(--accent-ink); }
.brand:hover .brand-dot { color: var(--ink); }

.nav { display: flex; gap: 4px; }
.nav a {
  padding: 8px 10px;
  border-radius: var(--radius-full);
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav .nav-cta { color: var(--paper); background: var(--ink); margin-left: 6px; }
.nav .nav-cta:hover { color: var(--paper); background: #2a2a2a; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: clamp(40px, 6vw, 88px) 0 clamp(64px, 8vw, 120px); }

.hero-meta {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ink);
  color: var(--ink-2);
}
.hero-meta > :nth-child(1) { grid-column: span 3; }
.hero-meta > :nth-child(2) { grid-column: span 5; }
.hero-meta > :nth-child(3) { grid-column: span 4; text-align: right; }
/* 태그라인은 항목 단위로만 줄바꿈한다. 각 항목 앞의 "·"를 왼쪽 여백에 두고 넘친 부분을 잘라,
   줄 끝이나 줄 첫머리에 구분점이 홀로 남지 않게 한다. */
.tagline { overflow: hidden; }
.tagline-list { display: flex; flex-wrap: wrap; margin-left: -1.6em; }
.tagline-list > span { white-space: nowrap; }
.tagline-list > span::before { content: '·'; display: inline-block; width: 1.6em; text-align: center; }

.hero-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: clamp(28px, 4vw, 48px);
}
.hero-name {
  /* "JINHWAN PARK" 한 줄(약 7.2em 폭). 이전 두 줄 배치(19.6vw, 최대 288px)의 절반 크기다. */
  font-size: clamp(34px, 9.8vw, 144px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.hero-alt {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-bottom: 0.3em;
  text-align: right;
  white-space: nowrap;
}
.hero-alt .ko {
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.hero-alt .aka { color: var(--ink-3); text-transform: none; letter-spacing: 0.02em; font-size: 13px; }
.hero-alt .aka b { color: var(--ink); font-weight: 600; }

.hero-body {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-top: clamp(40px, 5vw, 72px);
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.hero-role {
  grid-column: 1 / span 6;
  font-size: clamp(30px, 3.4vw, 50px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
  /* 역할이 두 줄이 될 때 줄 길이를 맞춘다. 빌드가 "&"를 앞 단어에, 마지막 두 단어를 서로
     &nbsp;로 묶으므로 balance 미지원 브라우저에서도 "&"가 줄 첫머리에 오거나 "Engineer"만
     홀로 남지 않는다. */
  text-wrap: balance;
}
.hero-role .dot {
  display: inline-block;
  width: 0.34em; height: 0.34em;
  margin: 0 0.18em 0.12em 0;
  border-radius: 50%;
  background: var(--accent-ink);
}
.hero-intro {
  grid-column: 8 / span 5;
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.65;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip {
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  background: #fbfbf8;
}

.hero-index {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  margin-top: clamp(48px, 6vw, 88px);
  border-top: 1px solid var(--ink);
}
.hero-index a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px 0 0;
  text-decoration: none;
  color: var(--ink-2);
  transition: color 0.15s;
}
.hero-index a span:last-child { font-family: var(--sans); text-transform: none; letter-spacing: -0.01em; font-size: 15px; font-weight: 600; color: var(--ink); }
.hero-index a:hover span:last-child { color: var(--accent-ink); }

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: var(--section-y) 0; }
.section + .section:not(.dark) { padding-top: 0; }

.section-head {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: start;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
  margin-bottom: clamp(40px, 5vw, 72px);
}
.section-head .mono { grid-column: span 3; color: var(--ink-3); padding-top: 12px; }
.section-head h2 {
  grid-column: span 9;
  font-size: clamp(44px, 6.4vw, 96px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.section-head h2 em { font-style: normal; color: var(--ink-3); }
.section-head .lede {
  grid-column: 4 / span 6;
  color: var(--ink-2);
  font-size: 18px;
}

.dark {
  background: var(--bg);
  color: var(--text-1);
}
.dark .section-head { border-top-color: var(--border); }
.dark .section-head .mono { color: var(--text-3); }
.dark .section-head h2 em { color: var(--text-3); }
.dark .section-head .lede { color: var(--text-2); }

/* ---------- Prize ---------- */
.prize-list { border-bottom: 1px solid var(--rule); }
.prize {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: baseline;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}
.prize:first-child { border-top: 0; padding-top: 0; }
.prize-award {
  grid-column: span 3;
  font-size: clamp(32px, 3.6vw, 52px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.prize-body { grid-column: span 7; }
.prize-event { color: var(--ink-3); margin-bottom: 8px; }
.prize-project {
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.prize-note { margin-top: 6px; color: var(--ink-2); font-size: 16px; }
.prize-link { grid-column: span 2; justify-self: end; }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.arrow-link:hover { background: var(--ink); color: var(--paper); }
.arrow-link svg { width: 14px; height: 14px; flex: none; }

/* ---------- By the numbers ---------- */
/* 항목 수와 무관하게 동작하도록 "행의 첫 칸"을 nth-child 공식으로 잡는다(데스크톱 5열 · 태블릿 3열 · 모바일 1열). */
.figures {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.figure {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 28px 24px 30px;
  border-left: 1px solid var(--border);
}
.figure:nth-child(5n + 1) { border-left: 0; padding-left: 0; }
.figure:nth-child(n + 6) { border-top: 1px solid var(--border); }
.figure-value {
  order: -1;
  margin: 0;
  font-size: clamp(64px, 7.6vw, 116px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.055em;
  white-space: nowrap;
}
/* 글자 수(쉼표·기호 포함)에 따라 빌드가 붙이는 클래스. 긴 숫자가 칸을 넘거나 줄바꿈되지 않게 줄인다. */
.figure-value.is-long { font-size: clamp(48px, 4.6vw, 72px); }
.figure-value.is-xlong { font-size: clamp(36px, 3.4vw, 52px); }
.figure:first-child .figure-value { color: var(--accent); }
.figure-label {
  margin-top: 18px;
  color: var(--text-1);
  font-size: 13px;
}
.figure-evidence {
  margin: 8px 0 0;
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
}

/* ---------- Timeline ---------- */
.timeline-block {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-top: clamp(64px, 7vw, 104px);
}
.timeline-head { grid-column: span 3; color: var(--text-3); padding-top: 2px; }
.timeline {
  --node: 13px;
  grid-column: 4 / span 9;
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 16px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: calc(20px + 14px + var(--node) / 2);
  height: 1px;
  background: var(--border);
}
.tl-item {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tl-date { height: 20px; color: var(--text-2); white-space: nowrap; }
.tl-node {
  width: var(--node);
  height: var(--node);
  margin: 14px 0 18px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--bg);
}
.is-undated .tl-date { color: var(--text-3); font-family: var(--sans); letter-spacing: 0; }
.is-undated .tl-node { background: var(--bg); border: 1px dashed var(--text-3); }
.tl-name {
  font-size: clamp(20px, 1.9vw, 26px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  text-decoration: none;
  color: var(--text-1);
}
a.tl-name:hover { color: var(--accent); }
.tl-note { margin-top: 6px; color: var(--text-3); font-size: 14px; }

/* ---------- GitHub activity (features.githubActivity=true일 때만 렌더링) ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  overflow: hidden;
}
.stat { padding: 24px 24px 22px; border-left: 1px solid var(--border); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat dt { color: var(--text-3); }
.stat dd {
  margin: 14px 0 0;
  font-size: clamp(32px, 3.4vw, 48px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat dd small {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-2);
}
.stat-lead dd { color: var(--accent); }

.heat-card {
  margin-top: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}
.heat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  color: var(--text-3);
}
.heat-top a { color: var(--text-2); text-decoration: none; }
.heat-top a:hover { color: var(--text-1); }

.heat-scroll { overflow-x: auto; padding-bottom: 6px; scrollbar-color: var(--surface-3) transparent; }
.heat {
  --cell: 17px;
  --gap: 4px;
  display: grid;
  grid-template-columns: 28px auto;
  column-gap: 8px;
  width: max-content;
  min-width: 100%;
}
.heat-months,
.heat-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--cell);
  gap: var(--gap);
}
.heat-months { grid-column: 2; grid-template-rows: 16px; margin-bottom: 6px; }
.heat-months span { font-family: var(--mono); font-size: 11px; color: var(--text-3); white-space: nowrap; }
.heat-days {
  grid-column: 1;
  display: grid;
  grid-template-rows: repeat(7, var(--cell));
  gap: var(--gap);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-3);
  align-items: center;
}
.heat-grid { grid-column: 2; grid-template-rows: repeat(7, var(--cell)); }
.cell {
  width: var(--cell);
  height: var(--cell);
  border-radius: 4px;
  background: var(--heat-0);
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}
.cell.l1 { background: var(--heat-1); }
.cell.l2 { background: var(--heat-2); }
.cell.l3 { background: var(--heat-3); }
.cell.l4 { background: var(--heat-4); }

.heat-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  color: var(--text-3);
}
.legend { display: inline-flex; align-items: center; gap: 4px; }
.legend .cell { --cell: 12px; border-radius: 3px; }
.legend span:first-child { margin-right: 6px; }
.legend span:last-child { margin-left: 6px; }

.heat-empty { color: var(--text-2); padding: 24px 0; }

/* ---------- Projects slider ---------- */
.projects { padding-top: 0; }
.slider-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.slider-count { color: var(--text-3); }
.slider-count b { color: var(--text-1); font-weight: 600; }
.slider-btns { display: flex; gap: 8px; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 48px; height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-1);
  color: var(--text-1);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); border-color: #3a3a3a; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn svg { width: 18px; height: 18px; }

.slider-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(1080px, 88%);
  gap: 20px;
  overflow-x: auto;
  --edge: max(var(--gutter), calc((100% - var(--max)) / 2));
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--edge);
  padding: 0 var(--edge) 8px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.slider-track::-webkit-scrollbar { display: none; }

.slide {
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  overflow: hidden;
}
.slide-media {
  position: relative;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.slide-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: left top;
}
.soon-badge {
  position: absolute;
  left: 20px; top: 20px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: rgba(10, 10, 10, 0.72);
  color: var(--text-2);
}
.slide-body {
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 40px);
  min-width: 0;
}
.slide-index { color: var(--text-3); }
.slide-title {
  margin-top: 18px;
  font-size: clamp(40px, 4.6vw, 64px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}
.slide-sub { margin-top: 10px; color: var(--text-2); font-size: 16px; font-weight: 500; }
.slide-summary { margin-top: 22px; color: var(--text-1); font-size: 17px; line-height: 1.6; }
.slide-role { margin-top: 14px; color: var(--text-3); font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.tag {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
}
.slide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn svg { width: 14px; height: 14px; flex: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-1); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-disabled { border: 1px dashed #3a3a3a; color: var(--text-3); cursor: default; }

/* ---------- Private work ---------- */
.pw-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.pw-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: #fbfbf8;
  overflow: hidden;
  transition: border-color 0.15s;
}
.pw-card:hover { border-color: var(--ink); }
.pw-media {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.pw-media img { width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.pw-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.pw-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.pw-title {
  margin-top: 16px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.pw-title a { text-decoration: none; }
.pw-title a:hover { color: var(--accent-ink); }
.pw-sub { margin-top: 6px; color: var(--ink-2); font-size: 15px; font-weight: 600; }
.pw-summary { margin-top: 12px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.pw-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.pw-tags li {
  padding: 3px 10px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-full);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}
.pw-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 22px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.pw-link svg { width: 14px; height: 14px; transition: transform 0.2s; }
.pw-link:hover { color: var(--accent-ink); }
.pw-link:hover svg { transform: translateX(3px); }

/* 상태 배지: 색 + 점 모양 + 글자. 민트는 쓰지 않는다(DESIGN.md: 민트는 상태 표시 금지). */
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px 4px 9px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}
.status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.status-running { background: var(--ink); color: var(--paper); }
.status-dev { color: var(--ink); }
.status-paused { border-color: #b37a12; color: #7a4f00; background: #fbf3e2; }
.status-paused i { border-radius: 1px; width: 7px; height: 7px; background: none; border-left: 2px solid currentColor; border-right: 2px solid currentColor; }
.status-design { border-style: dashed; border-color: var(--ink-3); color: var(--ink-2); }
.status-design i { background: none; border: 1.5px solid currentColor; }
.access {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.access svg { width: 13px; height: 13px; flex: none; }
.access-ask { display: block; margin-top: 8px; color: var(--ink-3); font-size: 14px; }
.access-ask:hover { color: var(--ink); }
.status-line { margin-bottom: 14px; }

/* Mermaid 다이어그램(빌드 때 WebP로 렌더링) */
.diagrams { display: grid; gap: 20px; }
.diagram {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: #fbfbf8;
  overflow: hidden;
}
.diagram figcaption {
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.diagram-scroll { overflow-x: auto; padding: 8px; background: #fbfbf8; }
.diagram-scroll img { margin: 0 auto; max-width: 100%; }
/* 구조도는 좁은 칼럼에 넣으면 글자가 작아져서, 라벨 아래 본문 전체 폭을 쓴다. */
.case-block.full > .content { grid-column: 1 / -1; }
.diagram-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
}
.diagram-foot details { flex: 1 1 320px; min-width: 0; }
.diagram-full {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.diagram-full:hover { color: var(--ink); }
.diagram-full svg { width: 12px; height: 12px; }
.diagram summary {
  padding: 12px 18px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.diagram pre {
  margin: 0;
  padding: 0 18px 16px;
  max-height: 360px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-2);
  white-space: pre;
}

/* ---------- Repos ---------- */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.repo {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 26px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: #fbfbf8;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.2s;
}
.repo:hover { border-color: var(--ink); }
.repo-owner { color: var(--ink-3); }
.repo-name {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}
.repo-desc { margin-top: 14px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.repo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 24px;
  color: var(--ink-2);
  font-size: 13px;
}
.lang { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.lang::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink);
}
.repo-topics { color: var(--ink-3); text-align: right; }
.repo-arrow { position: absolute; top: 24px; right: 24px; width: 18px; height: 18px; color: var(--ink-3); transition: color 0.15s, transform 0.2s; }
.repo:hover .repo-arrow { color: var(--ink); transform: translate(2px, -2px); }
.repo-add {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px dashed var(--rule);
  border-radius: var(--radius-lg);
  padding: 26px;
  color: var(--ink-3);
  font-size: 14px;
  min-height: 250px;
}
.repo-add code { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }

/* ---------- Research ---------- */
.research-list { border-top: 1px solid var(--rule); }
.paper {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  padding: 40px 0;
  border-bottom: 1px solid var(--rule);
}
.paper-no { grid-column: span 1; color: var(--ink-3); padding-top: 10px; }
.paper-main { grid-column: 2 / span 6; }
.paper-title {
  font-size: clamp(30px, 3.4vw, 48px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.paper-org { margin-top: 14px; color: var(--ink-3); }
.paper-side { grid-column: 8 / span 5; }
.paper-credit {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
}
.paper-summary { margin-top: 16px; color: var(--ink-2); }
.paper-side .arrow-link { margin-top: 20px; }
.paper-nolink { margin-top: 20px; color: var(--ink-3); }

/* ---------- Contact ---------- */
.contact { padding-bottom: 40px; }
.contact-title {
  font-size: clamp(56px, 11vw, 168px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.055em;
}
.contact-title span { color: var(--text-3); }
.contact-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-top: clamp(40px, 5vw, 72px);
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.contact-grid > div { grid-column: span 6; }
.contact-label { color: var(--text-3); margin-bottom: 14px; }
.mail-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(22px, 2.6vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-1);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
  overflow-wrap: anywhere;
}
.mail-link:hover { color: var(--accent); }
.mail-link[hidden] { display: none; }
.mail-note { color: var(--text-2); font-size: 15px; }
.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(22px, 2.6vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  border-bottom: 2px solid var(--border);
  padding-bottom: 4px;
}
.gh-link:hover { border-bottom-color: var(--text-1); }
.gh-link svg, .mail-link svg { width: 0.8em; height: 0.8em; flex: none; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: clamp(72px, 9vw, 140px);
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
}

/* ==========================================================================
   Case page
   ========================================================================== */
.case-hero { padding: clamp(40px, 6vw, 88px) 0 clamp(40px, 5vw, 64px); }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); text-decoration: none; }
.back:hover { color: var(--ink); }
.back svg { width: 14px; height: 14px; }
.case-kicker { margin-top: clamp(32px, 4vw, 56px); color: var(--ink-3); }
.case-title {
  margin-top: 14px;
  font-size: clamp(60px, 12vw, 180px);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.055em;
}
.case-sub {
  margin-top: 20px;
  font-size: clamp(22px, 2.4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink-2);
}
.case-meta {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}
.case-meta > div { grid-column: span 4; }
.case-meta dt { color: var(--ink-3); margin-bottom: 10px; }
.case-meta dd { margin: 0; font-size: 16px; font-weight: 500; }
.case-meta .links { display: flex; flex-wrap: wrap; gap: 8px; }

.case-cover { background: var(--bg); padding: clamp(24px, 4vw, 56px) 0; }
.case-cover figure {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-1);
}
.case-cover img { width: 100%; }

.case-body { padding: var(--section-y) 0; }
.case-block {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  padding: 36px 0;
  border-top: 1px solid var(--rule);
}
.case-block:first-child { border-top: 1px solid var(--ink); }
.case-block > .mono { grid-column: span 3; color: var(--ink-3); padding-top: 8px; }
.case-block > .content { grid-column: 4 / span 8; }
.case-block .lead { font-size: clamp(20px, 1.9vw, 26px); font-weight: 500; line-height: 1.55; letter-spacing: -0.02em; }
.bullets li {
  position: relative;
  padding: 12px 0 12px 28px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
}
.bullets li:last-child { border-bottom: 0; }
.bullets li::before {
  content: '';
  position: absolute;
  left: 2px; top: 1.3em;
  width: 12px; height: 2px;
  background: var(--accent-ink);
}
.decisions { counter-reset: d; }
.decision { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.decision:first-child { padding-top: 4px; }
.decision:last-child { border-bottom: 0; }
.decision h3 {
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.decision h3::before {
  counter-increment: d;
  content: counter(d, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-ink);
}
.decision p { margin-top: 10px; color: var(--ink-2); padding-left: 34px; }

.case-gallery { background: var(--bg); padding: var(--section-y) 0; }
.case-gallery .section-head { margin-bottom: 40px; }
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  align-items: start;
}
.gallery figure {
  grid-column: span 12;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-1);
}
.gallery figure.half { grid-column: span 6; }
.gallery figure.phone { grid-column: span 3; }
.gallery figcaption { padding: 14px 18px; color: var(--text-2); font-size: 14px; border-top: 1px solid var(--border); }

.case-soon {
  padding: 48px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius-lg);
  color: var(--ink-2);
}
.case-soon p + p { margin-top: 8px; }

.case-next { padding: 0 0 var(--section-y); }
.case-next a {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
  text-decoration: none;
}
.case-next .mono { color: var(--ink-3); }
.case-next strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(40px, 6vw, 88px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.95;
}
.case-next a:hover strong { color: var(--accent-ink); }
.case-next svg { width: clamp(28px, 4vw, 56px); height: clamp(28px, 4vw, 56px); flex: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .nav a:not(.nav-cta) { display: none; }
  .hero-index { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); row-gap: 18px; }
  .figures { grid-template-columns: repeat(3, 1fr); }
  .figure:nth-child(n) { border-left: 1px solid var(--border); padding-left: 24px; border-top: 0; }
  .figure:nth-child(3n + 1) { border-left: 0; padding-left: 0; }
  .figure:nth-child(n + 4) { border-top: 1px solid var(--border); }

  /* 가로 레일은 칸이 좁아지면 날짜가 겹치므로 1100px 이하에서는 세로 레일로 바꾼다. */
  .timeline-block { grid-template-columns: 1fr; gap: 20px; }
  .timeline-head, .timeline { grid-column: 1; }
  .timeline { grid-auto-flow: row; gap: 0; }
  .timeline::before { left: calc(var(--node) / 2); right: auto; top: 8px; bottom: 8px; width: 1px; height: auto; }
  .tl-item {
    display: grid;
    grid-template-columns: var(--node) 1fr;
    column-gap: 18px;
    padding: 12px 0;
  }
  .tl-node { grid-column: 1; grid-row: 1 / span 3; margin: 4px 0 0; }
  .tl-date, .tl-name, .tl-note { grid-column: 2; }
  .tl-date { height: auto; white-space: normal; }
  .tl-name { margin-top: 4px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n + 4) { border-top: 1px solid var(--border); }
  .slide { grid-template-columns: 1fr; min-height: 0; }
  .slide-media { aspect-ratio: 16 / 10; border-right: 0; border-bottom: 1px solid var(--border); }
  .repo-grid { grid-template-columns: repeat(2, 1fr); }
  .pw-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero-meta { grid-template-columns: 1fr 1fr; row-gap: 8px; }
  .hero-meta > :nth-child(1) { grid-column: 1; }
  .hero-meta > :nth-child(2) { grid-column: 1 / -1; order: 3; }
  .hero-meta > :nth-child(3) { grid-column: 2; }
  .hero-title { flex-direction: column; align-items: flex-start; gap: 14px; }
  /* 모바일은 한 줄이 본문 폭(약 7.2em)을 채우도록 */
  .hero-name { font-size: 11.4vw; }
  .hero-alt { flex-direction: row; align-items: baseline; gap: 12px; padding-bottom: 0; text-align: left; }
  .hero-alt .ko { font-size: 22px; }
  .hero-body { grid-template-columns: 1fr; gap: 20px; }
  .hero-role, .hero-intro { grid-column: 1; }
  .hero-intro { font-size: 17px; }
  .hero-index { grid-template-columns: repeat(2, 1fr); }

  .section-head { grid-template-columns: 1fr; gap: 14px; }
  .section-head .mono, .section-head h2, .section-head .lede { grid-column: 1; }
  .section-head .mono { padding-top: 0; }
  .section-head .lede { font-size: 16px; }

  .prize { grid-template-columns: 1fr; gap: 12px; padding: 28px 0; }
  .prize-award, .prize-body, .prize-link { grid-column: 1; }
  .prize-link { justify-self: start; margin-top: 6px; }

  .figures { grid-template-columns: 1fr; }
  .figure:nth-child(n) {
    display: grid;
    grid-template-columns: 42% 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 16px;
    align-items: start;
    padding: 22px 0;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .figure:first-child { border-top: 0; }
  .figure-value { grid-column: 1; grid-row: 1 / span 2; font-size: 64px; }
  .figure-value.is-long { font-size: 44px; }
  .figure-value.is-xlong { font-size: 32px; }
  .figure-label { grid-column: 2; margin-top: 4px; }
  .figure-evidence { grid-column: 2; margin-top: 6px; }

  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 18px; }
  .stat:nth-child(n) { border-left: 1px solid var(--border); border-top: 1px solid var(--border); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:first-child { grid-column: 1 / -1; border-top: 0; }
  .stat:nth-child(2), .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(3), .stat:nth-child(5) { border-left: 1px solid var(--border); }
  .heat-card { padding: 18px 16px; }
  .heat { --cell: 13px; --gap: 3px; grid-template-columns: 22px auto; }
  .heat-foot { flex-direction: column; align-items: flex-start; }

  .slider-track { grid-auto-columns: calc(100% - var(--gutter) * 2 + 4px); gap: 12px; }
  .slide-body { padding: 22px 20px 24px; }
  .slide-summary { font-size: 16px; }
  .icon-btn { width: 44px; height: 44px; }

  .repo-grid { grid-template-columns: 1fr; }
  .pw-grid { grid-template-columns: 1fr; }
  .pw-body { padding: 20px; }
  /* 넓은 구조도는 줄이면 글자를 읽을 수 없어서, 모바일에서는 원래 크기에 가깝게 두고 가로 스크롤한다. */
  .diagram.wide .diagram-scroll img { max-width: none; width: 820px; }
  .repo, .repo-add { min-height: 0; }
  .repo-add { min-height: 120px; }

  .paper { grid-template-columns: 1fr; gap: 14px; padding: 32px 0; }
  .paper-no, .paper-main, .paper-side { grid-column: 1; }
  .paper-no { padding-top: 0; }

  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .contact-grid > div { grid-column: 1; }
  .site-footer { flex-direction: column; }

  .case-meta { grid-template-columns: 1fr; gap: 20px; }
  .case-meta > div { grid-column: 1; }
  .case-block { grid-template-columns: 1fr; gap: 14px; padding: 28px 0; }
  .case-block > .mono, .case-block > .content { grid-column: 1; }
  .decision p { padding-left: 0; }
  .gallery figure.half { grid-column: span 12; }
  .gallery figure.phone { grid-column: span 6; }
  .case-soon { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
