/* -----------------------------------------------------------
   Copyright (c) 2026 Ahngunism. All rights reserved.
   -----------------------------------------------------------
   File           : style.css
   Last updated:  : 20260809
   Version        : ver 1
   -----------------------------------------------------------
   2540 바로도장 — DesignKit Line(모노라인) 변형

   자체 팔레트를 쓴다(2106·2110 선례). 도장 사이트의 색은 사실상 둘뿐이라
   킷의 컬러 테마 20종이 오히려 방해가 된다 — 무채 계조 + 인주(印朱) 단 한 색.

   architecture.md §6 「기피 디자인」 준수:
     글래스·backdrop-filter · 그라디언트 배경/버튼 · 글로우/네온 · 항목별 다색
     · 큰/다중 그림자 — 전부 쓰지 않는다. 평면(flat) · 헤어라인 · 여백으로만 만든다.
----------------------------------------------------------- */

:root {
  --ink: #b91c1c;              /* 인주색 — 유일한 액센트 */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --line: #e6e6e6;
  --line-2: #d4d4d4;
  --text: #1c1c1c;
  --text-2: #5c5c5c;
  --text-3: #8c8c8c;
  --focus: #1c1c1c;

  --r: 3px;                    /* 모서리는 거의 각지게 — 도장의 인상 */
  --w-page: 1160px;
  --t: 140ms cubic-bezier(.4, 0, .2, 1);
}

[data-theme="dark"] {
  --bg: #121212;
  --surface: #181818;
  --surface-2: #1f1f1f;
  --line: #2b2b2b;
  --line-2: #3a3a3a;
  --text: #ededed;
  --text-2: #a8a8a8;
  --text-3: #7a7a7a;
  --focus: #ededed;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
               'Malgun Gothic', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

/* ─── 헤더 ─────────────────────────────────────────────── */

.hd {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.hd__in {
  max-width: var(--w-page);
  margin: 0 auto;
  height: 58px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.hd__logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
/* 로고 마크 = 작은 도장 */
.hd__mark {
  width: 26px; height: 26px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.hd__nav { display: flex; gap: 18px; margin-left: auto; align-items: center; }
.hd__nav a {
  font-size: 13.5px;
  color: var(--text-2);
  text-decoration: none;
  transition: color var(--t);
}
.hd__nav a:hover, .hd__nav a[aria-current="page"] { color: var(--text); }

.iconbtn {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--r);
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: border-color var(--t), color var(--t);
}
.iconbtn:hover { border-color: var(--line-2); color: var(--text); }

/* ─── 레이아웃 ─────────────────────────────────────────── */

main { flex: 1; width: 100%; }

.wrap {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: 0 20px;
}

.tool {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0 56px;
  align-items: start;
}
@media (max-width: 900px) {
  .tool { grid-template-columns: 1fr; gap: 20px; padding-top: 16px; }
}

/* ─── 미리보기 ─────────────────────────────────────────── */

.pv { position: sticky; top: 78px; }
@media (max-width: 900px) {
  .pv {
    position: sticky; top: 58px;
    z-index: 20;
    background: var(--bg);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }
}

.pv__stage {
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  min-height: 300px;
  /* 투명 배경임을 보여주는 체커보드 — 이 도구의 핵심 약속이다 */
  background-image:
    linear-gradient(45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-2) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface-2) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
@media (max-width: 900px) {
  .pv__stage { min-height: 200px; padding: 16px; }
}

#preview {
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  display: block;
}
@media (max-width: 900px) { #preview { max-height: 168px; } }

.pv__meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

/* 선택한 글씨체가 입력 글자를 못 그릴 때(일본어 폰트에 한글 등) */
.pv__warn {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  border-left: 2px solid var(--ink);
  padding-left: 9px;
}
.pv__warn[hidden] { display: none; }

.pv__actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

/* ─── 버튼 ─────────────────────────────────────────────── */

.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--t), background var(--t), color var(--t);
  white-space: nowrap;
}
.btn:hover { border-color: var(--text); }
.btn--primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.btn--primary:hover { background: #a01818; border-color: #a01818; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost {
  width: 100%;
  margin-top: 8px;
  border-color: var(--line);
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
  padding: 9px 14px;
}
.btn--ghost:hover { border-color: var(--line-2); color: var(--text); }

/* ─── 컨트롤 패널 ──────────────────────────────────────── */

.panel { display: flex; flex-direction: column; gap: 22px; }

.fld { border: 0; }
.fld__t {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--text-3);
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  display: block;
}

.row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.row:last-child { margin-bottom: 0; }
.row > label { font-size: 13px; color: var(--text-2); font-weight: 500; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }

input[type="text"], select {
  font: inherit;
  font-size: 14px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--t);
}
input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--focus);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--ink);
  margin: 2px 0;
}

/* 선택형 칩 (형태·색·잉크·테두리) */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color var(--t), color var(--t);
  text-align: left;
}
.chip:hover { border-color: var(--text-2); color: var(--text); }
.chip[aria-pressed="true"] {
  border-color: var(--text);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--text);
}

/* 형태 선택 — 그룹 헤딩 + 라벨/설명 카드 */
.shapes__g {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  margin: 14px 0 7px;
}
.shapes__g:first-child { margin-top: 0; }
.shapes__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; }
.shape {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color var(--t);
}
.shape:hover { border-color: var(--text-2); }
.shape[aria-pressed="true"] { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.shape__n { font-size: 13.5px; font-weight: 600; color: var(--text); }
.shape__d { font-size: 11.5px; color: var(--text-3); line-height: 1.45; }

/* 색 견본 */
.swatch {
  width: 30px; height: 30px;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  cursor: pointer;
  padding: 0;
  transition: transform var(--t);
}
.swatch[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--bg), 0 0 0 1.5px var(--text); }

/* 폰트 그룹 아코디언 — 그룹을 펼칠 때만 그 그룹 웹폰트를 받는다 */
.fgrp { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; overflow: hidden; }
.fgrp__h {
  width: 100%;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 0;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.fgrp__c { padding: 10px; display: none; }
.fgrp[data-open="1"] .fgrp__c { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.fgrp__n { color: var(--text-3); font-weight: 400; font-size: 11.5px; }

.fchip {
  font-size: 15px;
  padding: 9px 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  line-height: 1.3;
  text-align: center;
  transition: border-color var(--t);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fchip:hover { border-color: var(--text-2); }
.fchip[aria-pressed="true"] { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }

/* 슬라이더 행 */
.sl { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.sl__v {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: right;
}

/* 서명 — 손그리기 패드 */
.pad {
  width: 100%;
  aspect-ratio: 620 / 240;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  cursor: crosshair;
  touch-action: none;   /* 손가락으로 그을 때 화면이 스크롤되면 안 된다 */
  display: block;
  margin-top: 4px;
}
.pad__actions { display: flex; gap: 8px; margin-top: 8px; }
.pad__actions .btn { flex: 1; padding: 8px 12px; font-size: 13px; }

.hint { font-size: 12px; color: var(--text-3); line-height: 1.55; margin-top: 6px; }

input[type="file"] {
  font: inherit;
  font-size: 13px;
  width: 100%;
  padding: 9px 11px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
}
input[type="file"]:focus { outline: none; border-color: var(--focus); }

details.adv { border-top: 1px solid var(--line); padding-top: 12px; }
details.adv > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  list-style: none;
  padding: 2px 0;
}
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::before { content: '▸ '; color: var(--text-3); }
details.adv[open] > summary::before { content: '▾ '; }
details.adv > div { padding-top: 12px; }

/* ─── 고지 ─────────────────────────────────────────────── */

.note {
  border: 1px solid var(--line);
  border-left: 2px solid var(--ink);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  background: var(--surface-2);
}
.note b { color: var(--text); font-weight: 600; }
.note ul { margin: 6px 0 0; padding-left: 16px; }
.note li { margin-bottom: 3px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--r);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t), transform var(--t);
  z-index: 90;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast[data-show="1"] { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── 푸터 ─────────────────────────────────────────────── */

.ft {
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding: 28px 0 40px;
  font-size: 13px;
  color: var(--text-3);
}
.ft__in { max-width: var(--w-page); margin: 0 auto; padding: 0 20px; display: grid; gap: 14px; }
.ft__links { display: flex; flex-wrap: wrap; gap: 16px; }
.ft__links a { color: var(--text-2); text-decoration: none; }
.ft__links a:hover { color: var(--text); text-decoration: underline; }
.ft__legal { font-size: 12px; line-height: 1.7; }

/* ─── 광고 (architecture.md §4-2) ───────────────────────
   래퍼에 border-radius·overflow 금지 — 애드핏 심사 규정.        */
.ad-grid {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; width: 100%; max-width: 672px;
  margin: 24px auto;
}
.ad-grid[data-ad-layout="mixed"] { max-width: 760px; }
.ad-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; }
.ad-cell { min-height: 50px; }

/* ─── 콘텐츠 페이지 (형태·글씨체·가이드·소개) ───────────── */

.doc { max-width: 780px; padding-top: 22px; padding-bottom: 56px; }

.crumb { font-size: 12.5px; color: var(--text-3); margin-bottom: 14px; }
.crumb a { color: var(--text-2); text-decoration: none; }
.crumb a:hover { color: var(--text); text-decoration: underline; }

.doc h1 {
  font-size: 30px;
  line-height: 1.3;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin-bottom: 10px;
}
@media (max-width: 560px) { .doc h1 { font-size: 24px; } }

.doc__lead { font-size: 16px; color: var(--text-2); line-height: 1.7; margin-bottom: 22px; }

.doc h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 30px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.doc__body h2:first-child { border-top: 0; padding-top: 0; margin-top: 8px; }

.doc__body p { margin-bottom: 14px; line-height: 1.8; }
.doc__body ul, .doc__body ol { margin: 0 0 14px 20px; }
.doc__body li { margin-bottom: 7px; line-height: 1.75; }
.doc__body b { font-weight: 700; }
.doc__body a { color: var(--ink); }

.cnt { font-size: 13px; font-weight: 400; color: var(--text-3); }

/* 카드 목록 (형태·가이드) */
.scards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.scard {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  transition: border-color var(--t);
}
.scard:hover { border-color: var(--text-2); }
.scard b { font-size: 14.5px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.scard span { font-size: 12.5px; color: var(--text-3); line-height: 1.55; }

/* 글씨체 목록 */
.fitems { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 0; list-style: none; }
.fitem {
  display: flex; flex-direction: column; gap: 1px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.fitem b { font-size: 14px; font-weight: 600; }
.fitem span { font-size: 11.5px; color: var(--text-3); }

/* 홈 하단 설명 */
.lead { max-width: 780px; margin: 8px auto 0; padding-bottom: 40px; }
.lead h2 {
  font-size: 19px; font-weight: 700; letter-spacing: -0.02em;
  margin: 30px 0 10px; padding-top: 20px; border-top: 1px solid var(--line);
}
.lead > h2:first-child { border-top: 0; padding-top: 0; }
.lead p { line-height: 1.8; color: var(--text-2); margin-bottom: 14px; }

.fcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; list-style: none; margin: 0 0 8px; }
.fcard {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 15px; border: 1px solid var(--line); border-radius: var(--r);
}
.fcard b { font-size: 14.5px; font-weight: 600; color: var(--text); }
.fcard span { font-size: 13px; color: var(--text-2); line-height: 1.65; }

.steps { margin: 0 0 14px 20px; }
.steps li { margin-bottom: 8px; line-height: 1.75; color: var(--text-2); }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0; }
.cta__d { font-size: 13px; color: var(--text-3); flex: 1; min-width: 200px; }
.cta .btn { text-decoration: none; display: inline-block; }

.ft__langs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--text-3); }
.ft__langs a { color: var(--text-2); text-decoration: none; }
.ft__langs a:hover { color: var(--text); text-decoration: underline; }
.ft__langs span[aria-current] { color: var(--text); font-weight: 600; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
