/* 색은 로고(logo.svg)의 세 색에서: 먹, 종이, 주황. 밝게/어둡게는 시스템 설정을 따름
   대비: 본문 17:1, 보조 글자 밝게 7.0:1 / 어둡게 7.6:1. 주황은 글자색으로 쓰지 않고 막대와 표시에만 */
:root {
  --paper: #f0eee9; --plate: #e4e1d9; --ink: #141416; --muted: #55524d; --rule: #c9c5bb;
  --accent: #f4511e;
  /* 글꼴은 명조 하나(Noto Serif KR 400, 700), fonts/에 직접 담음 */
  --serif: "Noto Serif KR", "AppleMyungjo", "Batang", ui-serif, serif;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #141416; --plate: #1f1f22; --ink: #f0eee9; --muted: #aba8a2; --rule: #38383c; }
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font: 1rem/1.7 var(--serif);
  word-break: keep-all; -webkit-text-size-adjust: 100%;
  min-height: 100vh; display: flex; flex-direction: column;
}
.wrap { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 clamp(1rem, 5vw, 4rem); }

header .wrap { height: 72px; display: flex; align-items: center; justify-content: space-between; }
.brand { color: inherit; text-decoration: none; min-height: 44px; display: flex; align-items: center; gap: 12px; font: 700 1.25rem/1 var(--serif); letter-spacing: -0.02em; }
/* 상단 메뉴 링크. 누르는 영역 44px */
nav { display: flex; gap: clamp(1rem, 3vw, 2.5rem); }
nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: inherit; font-size: 0.9375rem; font-weight: 700; text-decoration: none; }
nav a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--accent); text-underline-offset: 8px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
#services { scroll-margin-top: 24px; }
nav a:focus-visible, footer a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.brand img { width: 32px; height: 32px; display: block; }

main { flex: 1; }
.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2rem; padding: clamp(3rem, 10vw, 8rem) 0 clamp(3rem, 8vw, 6rem); }
h1 { font: 700 clamp(2.5rem, 7vw + 0.5rem, 6.5rem)/1.02 var(--serif); letter-spacing: -0.04em; }
/* 로고의 표식을 크게: 꺾쇠는 글자색, 막대는 주황 */
.mark { width: clamp(7rem, 20vw, 16rem); height: auto; display: block; }
@media (max-width: 40rem) { .hero { grid-template-columns: 1fr; } .mark { width: 5rem; order: -1; } }

.count { display: flex; justify-content: space-between; padding-bottom: 12px; border-bottom: 2px solid var(--ink); font-size: 0.875rem; font-weight: 700; }
.count span { color: var(--muted); font-variant-numeric: tabular-nums; }

.lead { margin-top: clamp(1.25rem, 2.5vw, 2rem); max-width: 34rem; font-size: clamp(1.0625rem, 0.5vw + 1rem, 1.3125rem); line-height: 1.6; color: var(--muted); }
.list { list-style: none; padding: 0; margin-bottom: clamp(4rem, 10vw, 8rem); }
/* 한 줄 전체가 링크: 번호, 이름, 설명, 화살표 */
.row {
  position: relative; display: grid; align-items: center; gap: 8px clamp(1rem, 3vw, 3rem);
  grid-template-columns: 3rem minmax(0, 6fr) minmax(0, 5fr) 3rem;
  padding: clamp(1.5rem, 3.5vw, 2.75rem) clamp(0.5rem, 1.5vw, 1.5rem);
  border-bottom: 1px solid var(--rule); color: inherit; text-decoration: none; cursor: pointer;
  transition: background-color .2s ease-out;
}
/* 줄 아래 주황 막대: 올리거나 포커스하면 왼쪽에서 자람 */
.row::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s ease-out; }
.row:hover, .row:focus-visible { background: var(--plate); }
.row:hover::after, .row:focus-visible::after { transform: scaleX(1); }
.row:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.no { font: 700 0.875rem/1 var(--serif); color: var(--muted); font-variant-numeric: tabular-nums; }
.name { font: 700 clamp(1.75rem, 3vw + 0.5rem, 3rem)/1.05 var(--serif); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.kind { display: block; margin-bottom: 4px; font-size: 0.875rem; font-weight: 700; color: var(--ink); }
.desc { color: var(--muted); max-width: 40ch; }
/* 누르면 어디로 가는지: 화살표만으로는 웹인지 내려받기인지 알 수 없어서 */
.go { display: block; margin-top: 8px; font-size: 0.875rem; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.arrow { justify-self: end; width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid var(--ink); transition: transform .2s ease-out, background-color .2s ease-out, color .2s ease-out; }
.arrow svg { width: 20px; height: 20px; }
.row:hover .arrow, .row:focus-visible .arrow { background: var(--ink); color: var(--paper); transform: translateX(4px); }
@media (max-width: 52rem) {
  .row { grid-template-columns: 2rem minmax(0, 1fr) 44px; }
  .row > div { grid-column: 2 / -1; grid-row: 2; }
  .arrow { grid-column: 3; grid-row: 1; }
}

/* 들어올 때 한 번: 줄이 차례로 올라옴 */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
h1, .lead, .mark, .count, .list li { animation: rise .45s ease-out backwards; }
.count { animation-delay: .1s; } .list li:nth-child(1) { animation-delay: .16s; } .list li:nth-child(2) { animation-delay: .22s; } .list li:nth-child(n+3) { animation-delay: .28s; }
@media (prefers-reduced-motion: reduce) { *, *::after { animation: none !important; transition: none !important; } }

footer { background: var(--plate); font-size: 0.875rem; color: var(--muted); }
.foot { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; padding-top: clamp(2.5rem, 6vw, 4rem); padding-bottom: clamp(2rem, 4vw, 3rem); }
@media (max-width: 40rem) { .foot { grid-template-columns: 1fr; gap: 24px; } }
.foot .brand { color: var(--ink); } .foot p { margin-top: 12px; }
.foot h2 { font-size: 0.875rem; font-weight: 700; color: var(--ink); }
.foot ul { list-style: none; padding: 0; }
.copy { padding-top: 16px; padding-bottom: 24px; border-top: 1px solid var(--rule); }
footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 4px; }

/* 문의 화면 (contact.html) */
.page { max-width: 40rem; padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(4rem, 10vw, 8rem); }
.page h1 { font-size: clamp(2.25rem, 4vw + 1rem, 3.75rem); }
.page .lead + p { margin-top: 12px; color: var(--muted); }
.page a { color: var(--ink); text-underline-offset: 4px; }
.page a:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
form { margin-top: clamp(2rem, 5vw, 3rem); padding-top: 24px; border-top: 2px solid var(--ink); display: grid; gap: 24px; }
label, legend { display: block; margin-bottom: 8px; font-size: 0.875rem; font-weight: 700; }
input:not([type="checkbox"]), select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--ink); border-radius: 0;
  background: var(--paper); color: var(--ink); font: inherit;
}
textarea { resize: vertical; line-height: 1.6; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
fieldset { border: 0; padding: 0; min-width: 0; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 0; font-weight: 400; font-size: 1rem; cursor: pointer; }
.check input { width: 20px; height: 20px; flex: none; accent-color: var(--ink); }
.hint { font-size: 0.875rem; color: var(--muted); }
details { margin-top: 8px; font-size: 0.875rem; }
summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
dl { display: grid; gap: 8px; color: var(--muted); }
dt { font-weight: 700; color: var(--ink); } dd { margin: 0; }
/* 주 버튼: 로고 주황 바탕에 먹 글자 (대비 4.9:1) */
button { justify-self: start; min-height: 48px; padding: 12px 40px; border: 0; border-radius: 0; background: var(--accent); color: #141416; font: 700 1rem/1 var(--serif); cursor: pointer; }
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .6; cursor: default; }
.status { font-weight: 700; }
/* 비어 있어도 접근성 트리에 남겨 두어 오류 문구가 들어오면 읽히게 (화면에서만 감춤) */
.status:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sent { margin-top: clamp(2rem, 5vw, 3rem); padding: 24px; background: var(--plate); border-top: 2px solid var(--ink); font-weight: 700; }
/* 사람에게는 보이지 않는 칸 (자동 입력 스크립트 거르기) */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--accent); text-underline-offset: 8px; }
[hidden] { display: none !important; }
