/* ===== N의 언어 — 아카이브 ===== */
/* 정제된 라이트 / 명조 제목 / 절제된 카테고리 색 */

:root {
  --paper:   #faf8f3;
  --paper-2: #f3efe6;
  --card:    #fffdfa;
  --ink:     #22201c;
  --ink-2:   #4a463f;
  --muted:   #837d72;
  --faint:   #b4ada0;
  --line:    #e7e2d8;
  --line-2:  #ddd6c8;
  --accent:  #2b2824;

  /* 카테고리 6색 (라이트에서 차분하게) */
  --c-phil: #4f5b7c;  /* 철학·인식 */
  --c-ai:   #3f7d78;  /* AI·기술 */
  --c-soc:  #a8743a;  /* 사회·정치·역사 */
  --c-art:  #9c5276;  /* 예술·문화·언어 */
  --c-life: #c0623f;  /* 삶·감정·관계 */
  --c-eth:  #6b5b95;  /* 윤리·종교·죽음 */

  --serif: 'Noto Serif KR', serif;
  --sans:  'Pretendard', -apple-system, system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(40,34,26,.04), 0 8px 24px rgba(40,34,26,.05);
  --shadow-lg: 0 4px 12px rgba(40,34,26,.08), 0 24px 60px rgba(40,34,26,.10);
  --r: 14px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; letter-spacing: -.003em;
}
h1,h2,h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.3; margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: #e9e2d2; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,248,243,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-in { max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; gap: 28px; height: 62px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand { cursor: pointer; }
.brand .logo { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.brand .sub { font-size: 11.5px; color: var(--faint); letter-spacing: .04em; }
.nav-tabs { display: flex; gap: 4px; margin-left: auto; }
.nav-tabs button {
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 14px; border-radius: 9px; font-size: 14px; transition: .15s; white-space: nowrap;
}
.nav-tabs button:hover { color: var(--ink); background: var(--paper-2); }
.nav-tabs button.on { color: var(--ink); background: #fff; box-shadow: var(--shadow); }

/* ===== View ===== */
.view { display: none; animation: fade .4s ease both; }
.view.on { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
section { padding: 48px 0; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.sec-title { font-size: 26px; margin-bottom: 6px; }
.sec-desc { color: var(--muted); margin-bottom: 26px; max-width: 640px; }

/* ===== Hero ===== */
.hero { padding: 76px 0 40px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 58%;
  background: url('assets/hero.png') no-repeat center right / cover;
  opacity: .85; mix-blend-mode: multiply; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 92% 76% at 74% 48%, #000 28%, transparent 70%);
  mask-image: radial-gradient(ellipse 92% 76% at 74% 48%, #000 28%, transparent 70%); }
@media (max-width: 980px) { .hero::after { opacity: .09; width: 85%; } }
.hero h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1.12; letter-spacing: -.025em; }
.hero h1 .light { color: var(--faint); font-weight: 400; }
.hero .lede { margin-top: 22px; font-size: 18px; color: var(--ink-2); max-width: 560px; line-height: 1.65; }
.hero-stats { display: flex; gap: 38px; margin-top: 36px; flex-wrap: wrap; }
.hstat .n { font-family: var(--serif); font-size: 32px; font-weight: 700; }
.hstat .l { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }

/* ===== 떠오르는 물음 ===== */
.muse {
  margin-top: 40px; background: linear-gradient(180deg, #fffdf8, #fbf7ee);
  border: 1px solid var(--line-2); border-radius: 18px; padding: 30px 32px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  min-height: 200px; display: flex; flex-direction: column; justify-content: center;
}
.muse::before { content: '?'; position: absolute; right: 18px; top: -26px;
  font-family: var(--serif); font-size: 160px; color: rgba(43,40,36,.035); font-weight: 700;
  pointer-events: none; }
.muse .tag { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.muse .q { font-family: var(--serif); font-size: clamp(19px, 2.4vw, 25px); line-height: 1.5;
  margin: 12px 0 16px; color: var(--ink); max-width: 760px; }
@keyframes museRise { from { opacity: 0; transform: translateY(10px); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: blur(0); } }
.muse .q.rise { animation: museRise .85s cubic-bezier(.2,.6,.2,1); }
.muse .meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.muse .dot { width: 8px; height: 8px; border-radius: 50%; }
.muse .from { color: var(--ink-2); }
.muse .more { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }
.muse .more button { border: 1px solid var(--line-2); background: #fff; color: var(--ink-2);
  border-radius: 9px; padding: 7px 14px; font-size: 13px; transition: .15s; white-space: nowrap; }
.muse .more button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== 카테고리 지형 ===== */
.terrain { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 12px; }
.terr {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 18px 16px; transition: .18s; cursor: pointer;
}
.terr:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.terr .top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.terr .swatch { width: 11px; height: 11px; border-radius: 3px; }
.terr .cn { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.terr .big { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1; }
.terr .unit { font-size: 12px; color: var(--muted); margin-left: 4px; }
.terr .bar { height: 4px; border-radius: 3px; background: var(--paper-2); margin-top: 12px; overflow: hidden; }
.terr .bar span { display: block; height: 100%; border-radius: 3px; }

/* 일별 흐름 미니차트 */
/* 🔴 col에 정의된 height 필수 — 없으면 bar2 height:%가 0으로 붕괴(막대 안보임) */
.flow-chart { display: flex; align-items: stretch; gap: 8px; height: 120px; padding: 6px 0; }
.flow-chart .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  position: relative; padding-bottom: 20px; box-sizing: border-box; }
.flow-chart .bar2 { width: 100%; max-width: 38px; min-height: 3px; background: linear-gradient(180deg,#cdbf9f,#b6a786);
  border-radius: 6px 6px 0 0; transition: .2s; }
.flow-chart .col:hover .bar2 { background: linear-gradient(180deg,#a8743a,#8f6230); }
.flow-chart .dl { font-size: 11px; color: var(--muted); position: absolute; bottom: 0; left: 0; right: 0; text-align: center; }

.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.panel h3 { font-size: 17px; margin-bottom: 4px; }
.panel .ph-desc { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

/* ===== 필터바 ===== */
.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 24px;
  position: sticky; top: 62px; background: rgba(250,248,243,.9); backdrop-filter: blur(8px);
  padding: 14px 0; z-index: 20; border-bottom: 1px solid var(--line); }
.chip { border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2);
  padding: 7px 13px; border-radius: 20px; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; transition: .15s; }
.chip:hover { border-color: var(--faint); }
.chip.on { color: #fff; border-color: transparent; }
.chip .sw { width: 9px; height: 9px; border-radius: 50%; }
.search { margin-left: auto; position: relative; }
.search input { border: 1px solid var(--line-2); background: #fff; border-radius: 20px;
  padding: 8px 16px 8px 36px; font-size: 13.5px; width: 230px; font-family: inherit; color: var(--ink); outline: none; transition: .15s; }
.search input:focus { border-color: var(--faint); width: 260px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }

/* ===== 토픽 카드 그리드 ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 16px; }
/* 가로 캐러셀 (홈 최근 대화) */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.seemore { border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2);
  border-radius: 9px; padding: 8px 15px; font-size: 13px; white-space: nowrap; transition: .15s; flex-shrink: 0; }
.seemore:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.hscroll { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 14px;
  scroll-snap-type: x proximity; scroll-behavior: smooth; }
.hscroll .tcard { flex: 0 0 300px; scroll-snap-align: start; }
.hscroll::-webkit-scrollbar { height: 7px; }
.hscroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
.hscroll::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 820px) { .hscroll .tcard { flex: 0 0 82%; } }
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 0; overflow: hidden; cursor: pointer; transition: .18s; display: flex; flex-direction: column; }
.tcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.tcard .stripe { height: 4px; }
.tcard .body { padding: 18px 20px 16px; flex: 1; display: flex; flex-direction: column; }
.tcard .ccat { font-size: 11.5px; letter-spacing: .03em; font-weight: 600; margin-bottom: 9px; }
.tcard h3 { font-size: 18px; line-height: 1.34; margin-bottom: 9px; }
.tcard .hook { font-size: 13.5px; color: var(--muted); line-height: 1.6; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tcard .foot { display: flex; align-items: center; gap: 13px; margin-top: 16px; padding-top: 13px;
  border-top: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.tcard .foot .who { margin-left: auto; display: flex; align-items: center; gap: 5px; color: var(--muted); }
.avatars { display: flex; }
.avatars span { width: 22px; height: 22px; border-radius: 50%; margin-left: -6px; border: 2px solid var(--card);
  font-size: 10px; display: grid; place-items: center; color: #fff; font-weight: 600; }
.count-line { color: var(--muted); font-size: 13px; margin: 4px 0 20px; }

/* ===== 상세 패널 (drawer) ===== */
.overlay { position: fixed; inset: 0; background: rgba(34,32,28,.34); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: .25s; z-index: 100; }
.overlay.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(720px, 94vw);
  background: var(--paper); box-shadow: -20px 0 60px rgba(34,32,28,.18); z-index: 101;
  transform: translateX(100%); transition: transform .32s cubic-bezier(.4,0,.1,1); overflow-y: auto; }
.drawer.on { transform: none; }
.drawer .dhead { padding: 30px 38px 22px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(250,248,243,.92); backdrop-filter: blur(10px); z-index: 2; }
.drawer .dcat { font-size: 12px; font-weight: 600; letter-spacing: .03em; margin-bottom: 10px; display: inline-flex; align-items: center; gap: 7px; }
.drawer h2 { font-size: 27px; line-height: 1.28; letter-spacing: -.015em; }
.drawer .dmeta { display: flex; align-items: center; gap: 14px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
/* 공유/링크복사 — 작게(모바일 native share·데스크탑 클립보드 복사) */
.drawer .dshare { margin-left: auto; flex-shrink: 0; font-size: 12px; font-weight: 600; color: #8a5a1e;
  border: 1px solid var(--line-2); background: #fff; border-radius: 8px; padding: 5px 11px;
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; transition: .15s; }
.drawer .dshare:hover { background: rgba(168,116,58,.08); border-color: #cbb48f; }
.drawer .close { position: absolute; top: 26px; right: 30px; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font-size: 17px; line-height: 1; }
.drawer .close:hover { background: var(--accent); color: #fff; }
.dbody { padding: 30px 38px 80px; }
.dblock { margin-bottom: 30px; }
.dblock .lab { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 11px; }
.dblock .hooktext { font-family: var(--serif); font-size: 21px; line-height: 1.5; color: var(--ink); }
.dblock .gist { font-size: 14.5px; line-height: 1.78; color: var(--ink-2); }
.dblock .flow { font-size: 14.5px; line-height: 1.82; color: var(--ink-2); white-space: pre-line; }
/* 요지 — 항목 분리 */
.gist-list { list-style: none; padding: 0; margin: 0; }
.gist-list li { font-size: 14.5px; line-height: 1.7; color: var(--ink-2); padding: 10px 0 10px 18px;
  position: relative; border-bottom: 1px solid var(--line); }
.gist-list li:last-child { border-bottom: 0; }
.gist-list li::before { content: ''; position: absolute; left: 2px; top: 18px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
/* 흐름 — 단계 분리 */
.flowsteps { display: flex; flex-direction: column; }
.fstep { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.fstep:last-child { padding-bottom: 2px; }
.fstep .fnum { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; font-family: var(--sans); z-index: 1; }
.fstep::before { content: ''; position: absolute; left: 12.5px; top: 28px; bottom: 0; width: 1.5px; background: var(--line-2); }
.fstep:last-child::before { display: none; }
.fstep .ftxt { font-size: 14.5px; line-height: 1.74; color: var(--ink-2); padding-top: 3px; }
/* 본문 속 화자명 — 굵게 + tier색(inline). 알약 제거: 이름 덜 강조·카드와 통일 */
.nm { font-weight: 700; white-space: nowrap; }
.stance { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px; margin-bottom: 10px; }
.stance .who { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.stance .who .av { width: 22px; height: 22px; border-radius: 50%; font-size: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; }
.stance .txt { font-size: 13.5px; line-height: 1.66; color: var(--ink-2); }
.qlist { list-style: none; padding: 0; margin: 0; }
.qlist li { font-family: var(--serif); font-size: 16.5px; line-height: 1.55; padding: 13px 0 13px 26px;
  border-bottom: 1px dashed var(--line-2); position: relative; color: var(--ink); }
.qlist li::before { content: '?'; position: absolute; left: 0; top: 13px; color: var(--faint); font-weight: 700; }
.qlist li:last-child { border-bottom: 0; }
.ppl-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ppl-chips .pc { font-size: 12.5px; padding: 5px 11px; border-radius: 16px; background: var(--paper-2); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.ppl-chips .pc.major { background: #efe7d6; font-weight: 600; }

/* ===== 목소리 (사람들) ===== */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 14px; }
.vcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; transition: .16s; cursor: pointer; }
.vcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.vcard .vtop { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.vcard .av { width: 38px; height: 38px; border-radius: 50%; font-size: 15px; display: grid; place-items: center; color: #fff; font-weight: 700; font-family: var(--serif); }
.vcard .vn { font-weight: 600; font-size: 14.5px; line-height: 1.2; }
.vcard .vr { font-size: 11.5px; color: var(--muted); }

/* ===== 개별수여 마크 (서고지기·책장지기 칩 + Lorekeeper 사인) ===== */
@font-face { font-family: 'Allura'; font-style: normal; font-weight: 400;
  src: url('assets/allura.woff2') format('woff2'); }
.rolechip { font-size: 10.5px; color: #9c7b4a; background: rgba(168,116,58,.10);
  padding: 1.5px 7px; border-radius: 20px; font-weight: 700; letter-spacing: .02em;
  margin-left: 6px; vertical-align: middle; white-space: nowrap; }
.stance { position: relative; }
.stance.host { padding-bottom: 34px; }
/* Lorekeeper 사인 — 미해소 워터마크 톤(연하게). 개인카드(목소리)는 조금 진하게(.vsign) */
.lksign { position: absolute; right: 15px; bottom: 7px; font-family: 'Allura', cursive;
  font-size: 30px; line-height: 1.3; padding: .08em .12em .16em;
  background: linear-gradient(95deg,#c2a87f,#9a7d52 55%,#bca06f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: .42; transform: rotate(-6deg); transform-origin: right bottom; pointer-events: none; }
.vcard { position: relative; }
.vcard .vnums { position: relative; }
/* 사인 = 주요발화 옆 빈 공간(vnums 우측)에. '자주 함께' 줄 겹침 회피.
   목소리 카드는 옆 카테고리 색이 화려 → 사인 조금 더 진하게(.72 + 깊은 청동) */
.vcard .lksign.vsign { top: 50%; right: 2px; bottom: auto; opacity: .72; font-size: 25px;
  background: linear-gradient(95deg,#b58c47,#8a5a1e 55%,#a9772f);
  -webkit-background-clip: text; background-clip: text;
  transform: translateY(-50%) rotate(-6deg); transform-origin: center right; }
.vcard .vnums { display: flex; gap: 16px; margin-bottom: 12px; }
.vcard .vnums b { font-family: var(--serif); font-size: 19px; }
.vcard .vnums small { color: var(--muted); font-size: 11px; display: block; }
.vcard .vcats { display: flex; flex-wrap: wrap; gap: 5px; }
.vcard .vcats span { font-size: 11px; padding: 3px 8px; border-radius: 12px; color: #fff; }
.vcard.me { border: 1.5px solid var(--accent); box-shadow: var(--shadow); }

/* ===== 그래프 ===== */
#cy { width: 100%; height: 640px; background:
  radial-gradient(circle at 50% 40%, #fffdf8, #f4efe5); border: 1px solid var(--line); border-radius: 18px; }
.graph-legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0 0; font-size: 12.5px; color: var(--muted); }
.graph-legend span { display: inline-flex; align-items: center; gap: 6px; }
.graph-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.graph-ctrl { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }

/* ===== 물음들 ===== */
.qcards { columns: 3 280px; column-gap: 16px; }
.qcard { break-inside: avoid; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; cursor: pointer; transition: .16s; }
.qcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.qcard .q { font-family: var(--serif); font-size: 16px; line-height: 1.5; color: var(--ink); margin-bottom: 12px; }
.qcard .src { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* ===== misc ===== */
.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 14px; }
.foot { border-top: 1px solid var(--line); padding: 34px 0 60px; color: var(--faint); font-size: 12.5px; text-align: center; }
.loading { text-align: center; padding: 120px 0; color: var(--muted); font-family: var(--serif); font-size: 18px; }

@media (max-width: 820px) {
  .two-col { grid-template-columns: 1fr; }
  /* muse: 글자·분위기 우선 — 버튼은 아래 줄로 (세로 깨짐 차단) */
  .muse { padding: 26px 22px; }
  .muse .meta { flex-wrap: wrap; row-gap: 4px; }
  .muse .more { width: 100%; margin-left: 0; margin-top: 12px; justify-content: flex-end; }
  .qcards { columns: 1; }
  .wrap { padding: 0 22px; }
  .nav-in { padding: 0 20px; gap: 10px; height: 56px; }
  .brand .logo { font-size: 17px; }
  .brand .sub { display: none; }
  .nav-tabs { gap: 1px; }
  .nav-tabs button { padding: 7px 9px; font-size: 13px; }
  .hero { padding: 46px 0 30px; }
  .hero-stats { gap: 22px; }
  .filterbar { top: 56px; gap: 7px; }
  .search { margin-left: 0; flex: 1 1 100%; }
  .search input, .search input:focus { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .drawer .dhead { padding: 24px 22px 18px; }
  .drawer .close { top: 22px; right: 20px; }
  .dbody { padding: 24px 22px 72px; }
  #cy { height: 480px; }
}
