/* ============================================================================
   첫 화면(index.html) — 가운데 문패 + 문 두 짝(편집기 | 공유마당)
   ============================================================================
   색은 styles.css 변수만 쓴다(새 색 금지 — 다크·테마가 변수 값만 갈아끼운다).
   바탕은 흰색(--panel), 위아래는 조인다 — 문의·제안와 같은 결(사용자 확정).
   문패 높이를 묶어 두어 노트북 화면(높이 800px 안팎)에서 두 문까지 스크롤 없이 보이게 한다.
   ============================================================================ */

/* 편집기용 전면 판짜임(body 세로 flex · overflow:hidden · 글자 선택 막음)을 되돌린다 */
body.home {
  display: flex; flex-direction: column;
  height: auto; min-height: 100vh; overflow: visible;
  background: var(--panel);
  -webkit-user-select: text; user-select: text;
}
body.home [hidden] { display: none !important; }

/* ---------- 가운데 문패 ---------- */
/* 문패와 두 문을 한 덩이로 **세로 가운데**에 — 아래가 휑하게 비지 않게. 윗줄 링크만큼 위로
   치우치는 것은 눈높이가 화면 한가운데보다 조금 위라서 오히려 맞다.
   (윗줄 링크는 2026-10-01에 없앴다 — 문의·제안가 두 문 아래 띠로 내려왔다. 그 줄이 먹던
   높이만큼 위 여백을 늘려 문패 자리가 예전과 같게 했다.) */
.hm-main { flex: 1 0 auto; width: 100%; max-width: 880px; margin: 0 auto; padding: 40px 24px 40px; box-sizing: border-box;
           display: flex; flex-direction: column; justify-content: center; }
.hm-brand { display: flex; flex-direction: column; align-items: center; margin: 0 0 32px; }
.hm-logo { width: 130px; height: 140px; display: block; }
body.dark .hm-logo { filter: invert(1); }            /* 상단바 로고와 같은 수법 */
/* 워드마크는 editor.html의 패스를 복사해 인라인했다 — fill=currentColor라 다크를 저절로 따른다 */
.hm-word { margin: 14px 0 0; line-height: 0; font-size: 0; color: var(--ink); }
.hm-word svg { height: 34px; width: auto; display: block; }
.hm-sub { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); letter-spacing: .5em; margin-right: -.5em; }

/* ---------- 문 두 짝 — 칸 전체가 링크 ---------- */
.hm-doors { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 720px; margin: 0 auto; }
.hm-door {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 22px 20px 20px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--ink); text-decoration: none; min-width: 0;
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.hm-door:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.hm-door:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* 선 그림 — 격자는 옅게(--muted), 먹점·붓은 잉크, 앞장 악보는 진하게. 선만 쓰고 칠하지 않는다. */
.hm-ill { width: 96px; height: 72px; margin-bottom: 6px; overflow: visible; }
.hm-ill .hm-grid  { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.hm-ill .hm-sheet { fill: var(--panel); stroke: var(--ink); stroke-width: 1.6; }
.hm-ill .hm-ink   { fill: var(--ink); }
.hm-ill .hm-hit    { fill: var(--accent-tint); }
.hm-ill .hm-cursor { fill: var(--ink); stroke: var(--panel); stroke-width: 1.3; stroke-linejoin: round; }
.hm-door:hover .hm-ill .hm-grid { stroke: var(--ink); }

.hm-name { font-size: 17px; font-weight: 700; letter-spacing: .02em; }
.hm-desc { font-size: 12.5px; color: var(--muted); line-height: 1.55; word-break: keep-all; }
.hm-extra { margin-top: 4px; font-size: 12px; color: var(--accent); max-width: 100%;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 문의·제안 — 두 문 아래 길게 한 줄 ---------- */
/* 문과 같은 칸(테두리·모서리·hover)이되 낮게 눕힌다. 두 칸에 걸치도록 그리드 한 줄을 다 쓴다. */
.hm-bar {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 16px; text-align: left;
  padding: 14px 22px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--ink); text-decoration: none; min-width: 0;
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.hm-bar:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.hm-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hm-bar-ill { flex: 0 0 auto; width: 48px; height: 36px; overflow: visible; }
.hm-bar-ill .hm-grid  { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linejoin: round; }
.hm-bar-ill .hm-sheet { fill: var(--panel); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.hm-bar-ill .hm-ink   { fill: var(--ink); }
.hm-bar:hover .hm-bar-ill .hm-grid { stroke: var(--ink); }
.hm-bar-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hm-bar .hm-name { font-size: 15px; }
.hm-bar-go { flex: 0 0 auto; color: var(--muted); font-size: 16px; transition: transform .12s ease, color .12s ease; }
.hm-bar:hover .hm-bar-go { color: var(--accent); transform: translateX(3px); }

/* ---------- 꼬리말 ---------- */
.hm-foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px;
           padding: 16px 24px 20px; font-size: 11.5px; color: var(--muted); }
.hm-foot a { color: var(--muted); text-decoration: none; }
.hm-foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- 폰 — 편집기가 위, 공유마당이 아래 ---------- */
@media (max-width: 640px) {
  .hm-main { padding: 24px 16px 16px; }
  .hm-brand { margin-bottom: 22px; }
  .hm-logo { width: 98px; height: 105px; }
  .hm-word svg { height: 28px; }
  .hm-doors { grid-template-columns: 1fr; gap: 12px; }
  .hm-door { padding: 16px; }
  .hm-bar { padding: 12px 16px; gap: 12px; }
}
