/* Pado 구조 레이어: 머리글 · 내비게이션 · 인덱스 · 홈 */

/* ─────────────── 머리글 ─────────────── */
.masthead {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: color-mix(in oklch, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.masthead-in {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s5);
  height: 3.5rem;
}

.wordmark {
  display: inline-block;
  font-size: 1.3125rem; font-weight: 800;
  letter-spacing: -0.05em; color: var(--ink);
  padding-bottom: 0.16em;
  /* 물가 선. 로고를 이미지 없이 성립시키는 유일한 장식이다. */
  border-bottom: 2px solid var(--sig);
  transition: border-color var(--d2) var(--ease);
}
.wordmark:hover { border-bottom-color: var(--ink); }

.search {
  position: relative; display: flex; align-items: center;
  max-width: 30rem; width: 100%;
}
.search input {
  width: 100%; height: 2.125rem;
  padding: 0 2.25rem 0 var(--s3);
  font-size: var(--t-ui);
  color: var(--ink);
  background: var(--paper-sunk);
  border: 1px solid transparent;
  border-radius: var(--r2);
  transition: border-color var(--d1) var(--ease), background var(--d1) var(--ease);
}
.search input::placeholder { color: var(--ink-4); }
.search input:hover { background: var(--paper-2); }
.search input:focus { background: var(--paper-edge); border-color: var(--rule-2); outline-offset: 1px; }
.search kbd {
  position: absolute; right: var(--s2); pointer-events: none;
  font-family: var(--font-mono); font-size: var(--t-micro);
  color: var(--ink-4); border: 1px solid var(--rule-2);
  border-radius: var(--r1); padding: 0 0.3rem; line-height: 1.5;
}
.search input:focus + kbd { opacity: 0; }

.head-actions { display: flex; align-items: center; gap: var(--s2); }

.icon-btn {
  display: grid; place-items: center;
  width: 2.125rem; height: 2.125rem;
  border-radius: var(--r2); color: var(--ink-2);
  transition: background var(--d1) var(--ease), color var(--d1) var(--ease);
}
.icon-btn:hover { background: var(--paper-sunk); color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 1.0625rem; height: 1.0625rem; }

.avatar {
  width: 1.75rem; height: 1.75rem; border-radius: var(--pill);
  object-fit: cover; background: var(--paper-sunk);
}
.avatar-lg { width: 3rem; height: 3rem; }
.avatar-fallback {
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: var(--t-xs); font-weight: 600;
  color: var(--ink-2); background: var(--paper-sunk);
}

/* ─────────────── 구역 내비 ─────────────── */
.tide {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.tide-in { display: flex; align-items: stretch; gap: var(--s5); overflow-x: auto; scrollbar-width: none; }
.tide-in::-webkit-scrollbar { display: none; }
.tide a {
  position: relative; white-space: nowrap;
  display: inline-flex; align-items: center;
  padding: var(--s3) 0; font-size: var(--t-ui); font-weight: 500;
  color: var(--ink-3);
  transition: color var(--d1) var(--ease);
}
.tide a:hover { color: var(--ink); }
.tide a[aria-current='page'] { color: var(--ink); font-weight: 600; }
.tide a[aria-current='page']::after {
  content: ''; position: absolute; inset-inline: 0; bottom: -1px; height: 2px;
  background: var(--sig);
}
.tide .push-count {
  margin-inline-start: var(--s1);
  font-family: var(--font-mono); font-size: var(--t-micro); color: var(--ink-4);
}

/* ─────────────── 카테고리 필터 ─────────────── */
.filters {
  display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none;
  padding-block: var(--s3);
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
  height: 1.875rem; padding: 0 var(--s3);
  font-size: var(--t-sm); font-weight: 500; color: var(--ink-2);
  background: var(--paper-sunk); border-radius: var(--r2);
  transition: background var(--d1) var(--ease), color var(--d1) var(--ease);
}
.chip:hover { background: var(--paper-2); color: var(--ink); }
.chip:active { transform: scale(0.975); }
.chip[aria-pressed='true'], .chip.is-on {
  background: var(--ink); color: var(--paper);
}
.chip .n { font-family: var(--font-mono); font-size: var(--t-micro); opacity: 0.6; }

/* ─────────────── 인덱스 (아카이브 목록) ─────────────── */
.index { display: block; }

.index-group + .index-group { margin-top: var(--s6); }
.index-head {
  display: flex; align-items: baseline; gap: var(--s3);
  padding-bottom: var(--s2);
  border-bottom: 1px solid var(--rule-2);
  margin-bottom: var(--s1);
}
.index-head .date {
  font-family: var(--font-mono); font-size: var(--t-xs);
  letter-spacing: var(--tr-data); color: var(--ink-2); font-weight: 600;
}
.index-head .count { font-family: var(--font-mono); font-size: var(--t-micro); color: var(--ink-4); }

.index-row {
  display: grid;
  grid-template-columns: 2.25rem 1.5rem minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--s3);
  min-height: var(--row-h);
  padding-block: var(--row-pad-y);
  padding-inline: var(--s2);
  margin-inline: calc(var(--s2) * -1);
  border-radius: var(--r2);
  transition: background var(--d1) var(--ease);
}
.index-row:hover { background: var(--paper-sunk); }
.index-row:hover .rank { color: var(--sig); }

.rank {
  font-family: var(--font-mono); font-size: var(--t-xs);
  color: var(--ink-4); text-align: right;
  transition: color var(--d1) var(--ease);
}

.monogram {
  display: grid; place-items: center;
  width: 1.5rem; height: 1.5rem; border-radius: var(--r1);
  font-size: 0.8125rem; line-height: 1;
  background: oklch(var(--cat-l) var(--cat-c) var(--h, 60));
  color: oklch(var(--cat-ink-l) 0.11 var(--h, 60));
}

.index-main { min-width: 0; }
.index-title {
  display: block;               /* inline 이면 text-overflow 가 먹지 않는다 */
  font-size: var(--t-ui); font-weight: 500; color: var(--ink);
  letter-spacing: var(--tr-flat);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.index-row:hover .index-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2); }
.index-desc {
  display: block; font-size: var(--t-sm); color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px;
}
:root[data-density='compact'] .index-desc { display: none; }
.index-sub {
  display: flex; align-items: center; gap: var(--s2);
  font-family: var(--font-mono); font-size: var(--t-micro);
  color: var(--ink-4); margin-top: 1px;
}
.index-sub .dot { width: 2px; height: 2px; border-radius: 50%; background: currentColor; opacity: 0.5; }

.index-side { display: flex; align-items: center; gap: var(--s3); flex: none; }
.index-side .tags { display: flex; gap: var(--s1); }
.index-side .stat {
  font-family: var(--font-mono); font-size: var(--t-micro);
  color: var(--ink-4); min-width: 2.5rem; text-align: right;
}

@media (max-width: 46rem) {
  .index-row { grid-template-columns: 1.75rem 1.5rem minmax(0, 1fr); row-gap: var(--s1); }
  .index-side { grid-column: 3; justify-content: flex-start; }
  .index-side .tags { display: none; }
}

/* ─────────────── 너울 (상위 항목) ─────────────── */
.swell { display: grid; gap: var(--s4); }
.swell-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s4);
  align-items: start;
  padding-block: var(--s4);
  border-top: 1px solid var(--rule);
}
.swell-item:first-child { border-top: 0; padding-top: 0; }
.swell-index {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 2.25rem; line-height: 0.85;
  color: var(--ink-3); letter-spacing: -0.05em;
}
.swell-item:first-child .swell-index { color: var(--sig); font-size: 3rem; }
.swell-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: var(--t-lg); font-weight: 650; letter-spacing: var(--tr-tight);
  color: var(--ink);
}
.swell-item:first-child .swell-title { font-size: clamp(1.125rem, 0.95rem + 0.8vw, 1.5rem); }
.swell-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--ink-2); font-size: var(--t-sm); margin-top: var(--s1);
}
.swell-meta {
  display: flex; gap: var(--s3); margin-top: var(--s2);
  font-family: var(--font-mono); font-size: var(--t-micro); color: var(--ink-4);
}
.swell-item a:hover .swell-title { color: var(--sig-ink); }

/* ─────────────── 지면 구획 ─────────────── */
.section { padding-block: var(--section); }
.section + .section { padding-top: 0; }
.section-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: end; gap: var(--s4);
  margin-bottom: var(--s5);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--rule);
}
.section-head h2 { font-size: var(--t-h2); }
.section-head p { color: var(--ink-3); font-size: var(--t-sm); margin-top: var(--s2); max-width: 46ch; }
.section-head .more { font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; }
.section-head .more:hover { color: var(--sig-ink); }

/* ─────────────── 첫 화면 ─────────────── */
.opening { padding-block: clamp(2rem, 1.2rem + 2.4vw, 3.25rem) var(--s6); }
.opening-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(var(--s5), 4vw, var(--s8)); align-items: end;
}
.opening h1 {
  font-size: var(--t-display); font-weight: 800;
  letter-spacing: var(--tr-display); line-height: 0.98;
}
.opening h1 .ink-2 { color: var(--ink-3); }
.opening p { margin-top: var(--s4); color: var(--ink-2); font-size: var(--t-body); max-width: 40ch; }

.tally { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.tally div { border-top: 2px solid var(--ink); padding-top: var(--s2); }
.tally dt { font-size: var(--t-micro); color: var(--ink-3); font-family: var(--font-mono); letter-spacing: var(--tr-label); text-transform: uppercase; }
.tally dd {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); font-weight: 500;
  letter-spacing: -0.03em; margin-top: 0.1em;
}

@media (max-width: 52rem) {
  .opening-grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .masthead-in { grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); }
  .search kbd { display: none; }
}
@media (max-width: 34rem) {
  .masthead-in { height: 3.25rem; }
  .search { display: none; }
  .section-head { grid-template-columns: minmax(0, 1fr); }
}

/* ─────────────── 바닥글 ─────────────── */
.foot {
  margin-top: var(--s9);
  border-top: 1px solid var(--rule);
  padding-block: var(--s6) var(--s7);
  font-size: var(--t-sm); color: var(--ink-3);
}
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); gap: var(--s5); }
.foot h3 { font-size: var(--t-xs); font-family: var(--font-mono); letter-spacing: var(--tr-label); text-transform: uppercase; color: var(--ink-4); font-weight: 500; margin-bottom: var(--s3); }
.foot ul { list-style: none; padding: 0; display: grid; gap: var(--s2); }
.foot a:hover { color: var(--ink); }
@media (max-width: 52rem) { .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
