@import url("/static/fonts/fonts.css");
/* ==========================================================================
   사이트 머리글(templates/_header.html) — 사이트 페이지(base.html)와 설명서(/help, /help/connect)가 같이 쓴다.
   페이지마다 머리글 높이·폭이 달라 보이지 않게 여기 한 곳에서만 정한다.
   색은 각 페이지의 변수(--bg·--panel·--fg·--accent·--fill 등, 밝은/어두운 화면)를 쓴다.
   넓은 화면: 한 줄 64px(줄바꿈 없음). 1080px 이하: 로고 · EN · 해/달 · ☰ 한 줄 64px(같은 높이), 메뉴는 ☰ 로 펼친다.
   ========================================================================== */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; flex-wrap: nowrap;
  min-height: 64px; padding: 0 max(24px, calc((100% - 1080px) / 2 + 24px));
  background: var(--top-bg); border-bottom: 2px solid var(--fg);
  -webkit-backdrop-filter: saturate(140%) blur(10px); backdrop-filter: saturate(140%) blur(10px);
  font-family: system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  line-height: 1.3; box-sizing: border-box;
}
.top *, .top *::before, .top *::after { box-sizing: border-box; }
.top .brand {
  flex: none; display: inline-flex; align-items: center; gap: 0;
  font-family: "Barlow", system-ui, sans-serif; font-size: 24px; font-weight: 800; color: var(--fg); letter-spacing: -.01em;
  line-height: 40px; text-decoration: none;
}
.top .brand .mark { flex: none; margin-right: 9px; }
.top .brand:hover { text-decoration: none; }
.top .brand span { color: var(--accent); }
.top nav { display: flex; gap: 2px; align-items: center; flex-wrap: nowrap; justify-content: flex-end; margin-left: auto; white-space: nowrap; }
.top nav a {
  display: inline-flex; align-items: center; height: 40px;
  color: var(--dim); font-size: 16.5px; font-weight: 500; padding: 0 12px; border-radius: 8px; text-decoration: none;
}
.top nav a:hover { color: var(--fg); background: var(--panel); text-decoration: none; }
.top nav a.on { color: var(--fg); font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); border-radius: 8px 8px 0 0; }
.top nav a.cta {
  margin-left: 6px; padding: 0 16px; font-weight: 700; border-radius: 10px;
  background: var(--fill); border: 1px solid var(--fill); color: #fff;
}
.top nav a.cta:hover { background: var(--fill-hover); border-color: var(--fill-hover); }
.top nav a.ghost { margin-left: 6px; border: 1px solid var(--line2); border-radius: 10px; color: var(--fg); }
.top nav a.me { color: var(--accent2); font-size: 14px; font-weight: 600; }
.top-tools { order: 3; flex: none; display: flex; align-items: center; gap: 4px; }
.top .tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--dim);
  font: 600 14.5px/1 system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  cursor: pointer; text-decoration: none;
}
.top .tool:hover { color: var(--fg); border-color: var(--line2); background: var(--panel); }
.top .tool .i-sun { display: var(--show-sun); } .top .tool .i-moon { display: var(--show-moon); }
.top :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.nav-toggle { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.nav-burger { display: none; }

@media (max-width: 1080px) {
  .top { flex-wrap: wrap; gap: 8px; min-height: 64px; padding: 8px 16px; }
  .top .brand { line-height: 48px; }
  .top-tools { order: 0; margin-left: auto; }
  .top .tool { height: 44px; min-width: 44px; }
  .nav-burger {
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    width: 48px; height: 48px; margin-right: -8px; border-radius: 10px; cursor: pointer;
  }
  .nav-burger span, .nav-burger::before, .nav-burger::after {
    content: ""; display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--fg);
    transition: transform .15s, opacity .15s;
  }
  .nav-toggle:focus-visible + .nav-burger { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav-toggle:checked + .nav-burger { background: var(--panel2); }
  .nav-toggle:checked + .nav-burger::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked + .nav-burger span { opacity: 0; }
  .nav-toggle:checked + .nav-burger::after { transform: translateY(-7px) rotate(-45deg); }
  .top nav { display: none; flex-basis: 100%; margin-left: 0; white-space: normal; }
  .nav-toggle:checked ~ nav {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; padding: 6px 0 12px;
  }
  .top nav a, .top nav a.cta, .top nav a.ghost {
    display: flex; align-items: center; justify-content: center; text-align: center;
    height: auto; min-height: 48px; padding: 6px 10px; margin: 0; border-radius: 10px;
    background: var(--panel); border: 1px solid var(--line); color: var(--fg); font-size: 16.5px; line-height: 1.3;
  }
  .top nav a.me { color: var(--accent2); }
  .top nav a.on { box-shadow: none; border-color: var(--accent); }
  .top nav a.cta { background: var(--fill); border-color: var(--fill); color: #fff; }
}
/* ---- 공용 바닥글(templates/_footer.html) ---- */
footer.site-foot {
  color: var(--dim); font-size: 14px; line-height: 1.6; text-align: center;
  padding: 32px 24px 40px; border-top: 2px solid var(--fg); background: var(--bg2);
  font-family: system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}
.site-foot .foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin-bottom: 10px; }
.site-foot .foot-links a { color: var(--body, var(--fg)); font-size: 14.5px; text-decoration: none; }
.site-foot a { color: var(--dim); text-decoration: none; }
.site-foot a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.site-foot p { margin: 0; }
@media (max-width: 640px) {
  footer.site-foot { padding: 20px 16px 28px; }
  .site-foot .foot-links { gap: 0 18px; }
  .site-foot .foot-links a, .site-foot p a { display: inline-block; padding: 11px 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav-burger span, .nav-burger::before, .nav-burger::after { transition: none; }
}
