/* ======================================================
   AssistTalk 공통 헤더 — 랜딩 · 가이드 · 약관 · 블로그 전부 이 파일을 쓴다.
   (블로그는 원래 자체 헤더가 따로 있었는데, 모바일에서 모양이 달라져서 여기로 합쳤다)

   마크업은 landing/*.html 과 server/routes/blog.js 가 같은 모양으로 찍고,
   햄버거·서랍은 nav.js 가 이 클래스들을 그대로 만들어 붙인다.

   블로그(blog.css)는 :root 토큰이 랜딩(styles.css)과 다르다.
   그래서 이 파일은 페이지 토큰에 기대지 않고 헤더 안에서 쓸 값을 직접 들고 있는다.
   ====================================================== */
.nav, .nav-drawer, .nav-drawer-backdrop {
  --nh-coral: #FF6B47;
  --nh-ink: #111111;
  --nh-body: #3A3A3A;
  --nh-line: #ECEAE5;
  --nh-line-2: #E4E1D9;
  --nh-bg: #FAF8F4;
}

/* ── 헤더 바 ───────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(250, 248, 244, 0.78);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.scrolled {
  border-color: var(--nh-line);
  background: rgba(250, 248, 244, 0.92);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 40px;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.nav-mark { width: 28px; height: 28px; }
.nav-word {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--nh-ink);
}
.nav-word em { font-style: normal; color: var(--nh-coral); }
.nav-links {
  display: flex;
  gap: 28px;
  margin-left: 20px;
}
.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--nh-body);
  text-decoration: none;
  padding: 6px 0;
  transition: color .2s ease;
}
.nav-links a:hover { color: var(--nh-ink); }
.nav-links a.on { color: var(--nh-ink); font-weight: 700; }
.nav-cta {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* 헤더 안의 버튼 — 블로그처럼 .btn 정의가 없는 페이지에서도 같게 보이도록 여기서 완결한다 */
.nav .btn, .nav-drawer .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .2s ease, color .2s ease;
}
.nav .btn-primary, .nav-drawer .btn-primary {
  background: var(--nh-coral);
  color: #fff;
  box-shadow: 0 6px 20px -6px rgba(255, 107, 71, 0.55);
}
.nav .btn-primary:hover, .nav-drawer .btn-primary:hover {
  background: #FF5A34;
  box-shadow: 0 12px 28px -8px rgba(255, 107, 71, 0.65);
  transform: translateY(-1px);
}
.nav .btn-ghost, .nav-drawer .btn-ghost {
  background: transparent;
  color: var(--nh-body);
}
.nav .btn-ghost:hover, .nav-drawer .btn-ghost:hover { color: var(--nh-ink); }

/* ── 햄버거 ────────────────────────────────────────── */
.nav-burger {
  display: none;
  margin-left: auto;
  width: 42px; height: 42px;
  border: 1px solid var(--nh-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-burger span {
  display: block;
  width: 18px; height: 2px;
  border-radius: 2px;
  background: var(--nh-ink);
  transition: transform .18s ease, opacity .18s ease;
}
.nav-burger.on span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.on span:nth-child(2) { opacity: 0; }
.nav-burger.on span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── 서랍 ──────────────────────────────────────────── */
.nav-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 16, 14, 0.42);
  z-index: 90;
}
.nav-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(320px, 86vw);
  z-index: 91;
  background: #fff;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  padding: 14px 18px 24px;
  overflow-y: auto;
  animation: navDrawerIn .18s ease-out;
}
@keyframes navDrawerIn { from { transform: translateX(16px); opacity: .4; } to { transform: none; opacity: 1; } }
.nav-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 10px; margin-bottom: 6px;
  border-bottom: 1px solid var(--nh-line);
}
.nav-drawer-title { font-size: 13px; font-weight: 700; color: var(--nh-body); letter-spacing: .02em; }
.nav-drawer-close {
  border: none; background: none; cursor: pointer;
  font-size: 26px; line-height: 1; color: var(--nh-body);
  width: 40px; height: 40px; border-radius: 10px;
}
.nav-drawer-close:hover { background: var(--nh-line); color: var(--nh-ink); }
.nav-drawer-links { display: flex; flex-direction: column; }
.nav-drawer-links a {
  display: block;
  padding: 14px 4px;
  font-size: 16px; font-weight: 500; color: var(--nh-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--nh-line);
}
.nav-drawer-links a:active { background: var(--nh-line); }
.nav-drawer-cta { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.nav-drawer-cta .btn { width: 100%; justify-content: center; padding: 13px 18px; font-size: 15px; }
.nav-drawer-cta .btn-ghost { border: 1px solid var(--nh-line); background: #fff; }
.nav-drawer[hidden], .nav-drawer-backdrop[hidden] { display: none !important; }
body.nav-locked { overflow: hidden; }

/* ── 반응형 ────────────────────────────────────────── */
@media (max-width: 1024px) {
  /* 좁은 화면에선 가로 메뉴 대신 햄버거로 연다 */
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-cta { margin-left: 12px; }
}
@media (max-width: 680px) {
  .nav-inner { padding: 12px 20px; gap: 10px; }
  .nav-word { font-size: 16px; }
  .nav-cta { margin-left: auto; }
  .nav-cta .btn { padding: 9px 13px; font-size: 13.5px; }
  .nav-cta .btn-ghost { display: none; }   /* 로그인은 서랍 안에 있다 */
  .nav-burger { margin-left: 0; width: 40px; height: 40px; }
}
@media (max-width: 400px) {
  .nav-cta .btn { padding: 8px 11px; font-size: 12.5px; }
  .nav-word { font-size: 15px; }
  .nav-mark { width: 24px; height: 24px; }
}
