/* 손폰트 — 원고지와 만년필 잉크.
   한 가지 대담한 요소: 제목과 시연 문장이 서비스가 만든 손글씨 폰트로 그려진다. 나머지는 조용하게. */

@font-face {
  font-family: "Sonfonts Demo";
  src: url("/fonts/sonfonts-demo.woff2") format("woff2");
  font-display: swap;
}

:root {
  /* 따뜻한 종이 위의 먹과 테라코타 — 차분하고 부드럽게 */
  --paper: #faf9f5;
  --sheet: #f3f1ea;
  --card: #ffffff;
  --grid: #d9d4c7;           /* 원고지 선 (따뜻한 회색) */
  --grid-soft: #e8e5dc;
  --ink: #1f1e1b;
  --ink-soft: #57544d;
  --ink-faint: #8a867c;
  --green: #c4613f;          /* 포인트(행동). 변수 이름은 예전 그대로 */
  --green-ink: #ffffff;
  --warn: #8a5a00;
  --warn-bg: #fbf1dc;
  --danger: #a3271f;
  --danger-bg: #fbe9e6;
  --focus: #c4613f;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(31 30 27 / 0.04), 0 6px 24px rgb(31 30 27 / 0.06);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --hand: "Sonfonts Demo", "Pretendard Variable", Pretendard, sans-serif;
  --serif: "Noto Serif KR", "Apple Myungjo", "Batang", serif;
  --ui: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --cell: 3.2rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1f1e1b;
    --sheet: #262521;
    --card: #2b2a26;
    --grid: #47443d;
    --grid-soft: #36342f;
    --ink: #f2efe7;
    --ink-soft: #c9c4b8;
    --ink-faint: #9a958a;
    --green: #e08a68;
    --green-ink: #1f1e1b;
    --warn: #f3c46f;
    --warn-bg: #3a2f17;
    --danger: #ff9b8f;
    --danger-bg: #3d1e1a;
    --focus: #e08a68;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 28px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 1rem;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.02em; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: 1.45rem; margin-top: 2.2em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.fine { font-size: 0.875rem; color: var(--ink-faint); }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 34em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
main { min-height: 60vh; }

/* 머리 */
.site-head { border-bottom: 1px solid var(--grid-soft); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand-cell {
  display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border: 1.5px solid var(--grid);
  font-family: var(--hand); font-size: 1.35rem; font-weight: 400; color: var(--ink); margin-right: 2px;
}
.top-nav { display: flex; align-items: center; gap: 18px; font-size: 0.95rem; }
.top-nav a { color: var(--ink-soft); text-decoration: none; }
.top-nav a[aria-current="page"], .top-nav a:hover { color: var(--ink); text-decoration: underline; }
.top-nav form { margin: 0; }
.link-btn { background: none; border: 0; color: var(--ink-soft); font: inherit; cursor: pointer; padding: 0; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  border-radius: 6px; border: 1.5px solid var(--green); background: var(--green); color: var(--green-ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--green); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 0.92rem; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6em 0 0.8em; }

/* 히어로: 왼쪽 문구, 오른쪽 원고지 위의 손글씨 */
.hero { padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hand { font-family: var(--hand); font-weight: 400; letter-spacing: 0; }
.hero h1.hand { font-size: clamp(3rem, 8vw, 5.2rem); line-height: 1.12; margin-bottom: 0.4em; }
.hero-demo { background: var(--sheet); border: 1px solid var(--grid-soft); padding: 20px; }
.demo-label { display: block; font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 10px; }
.manuscript { overflow: hidden; }
.manuscript p { display: flex; flex-wrap: wrap; margin: 0; }
.gcell {
  width: var(--cell); height: var(--cell); display: grid; place-items: center; font-size: calc(var(--cell) * 0.72);
  border: 1px solid var(--grid); margin: 0 -1px -1px 0; color: var(--ink); line-height: 1;
}
.demo-input {
  width: 100%; margin-top: 14px; font: inherit; font-size: 1rem; padding: 10px 12px; border: 1px solid var(--grid);
  border-radius: 4px; background: var(--paper); color: var(--ink);
}

/* 순서: 실제로 순서가 있는 내용이라 번호를 원고지 칸에 */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 40px; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.step-cell { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border: 1.5px solid var(--grid); font-family: var(--hand); font-size: 1.7rem; }
.steps h3 { margin-bottom: 0.3em; }
.steps p { color: var(--ink-soft); margin: 0; }
.steps-section { padding: 24px 0 8px; }

/* 가격 */
.price-band { margin-top: 56px; }
.price-band > div { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--grid-soft); padding: 28px 0; display: grid; gap: 4px; justify-items: start; }
.price { font-size: 2.4rem; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 0.3em; }
.price .fine { font-size: 0.9rem; font-weight: 400; }
.checks { list-style: none; padding: 0; margin: 0 0 1.2em; display: grid; gap: 6px; }
.checks li { padding-left: 1.6em; position: relative; }
.checks li::before { content: ""; position: absolute; left: 0.2em; top: 0.55em; width: 0.7em; height: 0.4em; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }

/* 질문 */
.faq { margin-top: 24px; margin-bottom: 40px; }
.faq details { border-bottom: 1px solid var(--grid-soft); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--ink-soft); }

/* 글 */
.prose h2 { font-size: 1.2rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 0.3em 0; }
.legal h2 { margin-top: 1.8em; }

/* 폼 */
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; font-weight: 600; font-size: 0.95rem; }
.field input, .field select {
  font: inherit; font-weight: 400; padding: 11px 12px; border: 1px solid var(--grid); border-radius: 4px; background: var(--paper); color: var(--ink); width: 100%;
}
.field small { font-weight: 400; color: var(--ink-faint); }
.drop {
  display: grid; place-items: center; gap: 6px; text-align: center; min-height: 160px; padding: 20px;
  border: 2px dashed var(--grid); background: var(--sheet); cursor: pointer; border-radius: 6px;
}
.drop.over { border-color: var(--green); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-list { list-style: none; padding: 0; margin: 0; font-size: 0.95rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; }
.check input { margin-top: 0.35em; width: 1.1em; height: 1.1em; accent-color: var(--green); }

.notice { padding: 12px 14px; border-radius: 4px; background: var(--sheet); border-left: 3px solid var(--grid); }
.notice.warn { background: var(--warn-bg); border-color: var(--warn); color: var(--warn); }
.notice.error { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.notice.key { border-color: var(--green); }

/* 진행 */
.progress { height: 6px; background: var(--grid-soft); overflow: hidden; margin: 16px 0 8px; }
.progress > div { height: 100%; background: var(--green); transition: width 0.4s ease; }

/* 검수 격자: 원고지 */
.cells { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); border-left: 1px solid var(--grid); border-top: 1px solid var(--grid); }
.cell {
  position: relative; aspect-ratio: 1; border: 0; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid);
  background: #fff; padding: 0; cursor: pointer;
}
.cell img { width: 100%; height: 100%; object-fit: contain; }
.cell .tag { position: absolute; top: 2px; left: 4px; font-size: 0.72rem; color: #6c7a72; }
.cell.flag { box-shadow: inset 0 0 0 2px var(--warn); }
.cell.excluded img { opacity: 0.12; }
.cell.excluded::after { content: "뺌"; position: absolute; inset: auto 0 4px; text-align: center; font-size: 0.75rem; font-weight: 700; color: var(--danger); }
.cell.busy::before { content: "다시 자르는 중"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.7rem; background: rgb(255 255 255 / 0.75); color: #1c2541; }

/* 미리보기 */
.preview-text {
  width: 100%; min-height: 6.5em; font-family: var(--job-font, var(--ui)); font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.55;
  padding: 16px; border: 1px solid var(--grid); background: var(--sheet); color: var(--ink); resize: vertical;
}
.glyphs { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.8rem, 1fr)); max-height: 26rem; overflow: auto; border-left: 1px solid var(--grid-soft); border-top: 1px solid var(--grid-soft); }
.glyphs button {
  font-family: var(--job-font, var(--ui)); font-size: 1.6rem; aspect-ratio: 1; border: 0; border-right: 1px solid var(--grid-soft); border-bottom: 1px solid var(--grid-soft);
  background: transparent; color: var(--ink); cursor: pointer; padding: 0;
}
.glyphs button[aria-pressed="true"] { background: var(--green); color: var(--green-ink); }
.cand-row { display: grid; grid-template-columns: 3rem repeat(auto-fill, minmax(4.5rem, 6rem)); gap: 8px; align-items: center; margin: 10px 0; }
.cand-row .ch { font-family: var(--job-font, var(--ui)); font-size: 2rem; text-align: center; }
.cand { aspect-ratio: 1; border: 2px solid var(--grid-soft); background: #fff; padding: 0; cursor: pointer; font: inherit; font-size: 0.85rem; color: #1c2541; }
.cand[aria-pressed="true"] { border-color: var(--green); }
.cand img { width: 100%; height: 100%; }

/* 결제 */
.pay-box { border: 1px solid var(--grid-soft); background: var(--card); box-shadow: var(--shadow); padding: 28px; margin-top: 32px; }
.pay-methods { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0; }
.pay-methods label { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border: 1px solid var(--grid); border-radius: 4px; cursor: pointer; }
.bank { font-variant-numeric: tabular-nums; }

/* 대화상자 (영역 조정) */
dialog { border: 1px solid var(--grid); background: var(--paper); color: var(--ink); padding: 20px; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.crop-stage { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; background: #fff; touch-action: none; }
.crop-stage .page-img { position: absolute; max-width: none; user-select: none; }
.crop-stage .box { position: absolute; border: 2px solid var(--green); box-shadow: 0 0 0 9999px rgb(0 0 0 / 0.35); cursor: move; }
.crop-stage .handle { position: absolute; right: -11px; bottom: -11px; width: 22px; height: 22px; border-radius: 50%; background: var(--green); cursor: nwse-resize; }

/* 관리자 */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--grid-soft); white-space: nowrap; }
.meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.meta dt { color: var(--ink-faint); }
.meta dd { margin: 0; }
form.inline { display: inline; }
.filters a { margin-right: 12px; }

/* 꼬리 */
.site-foot { margin-top: 72px; border-top: 1px solid var(--grid-soft); padding: 28px 0 40px; font-size: 0.85rem; color: var(--ink-faint); }
.site-foot p { margin: 0 0 4px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.foot-links a { color: var(--ink-soft); }

@media (max-width: 760px) {
  .hero { padding-top: 32px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .steps { grid-template-columns: 1fr; }
  :root { --cell: 2.55rem; }
  .cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .top-nav { gap: 12px; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 포트폴리오 */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 28px 24px; margin: 28px 0; }
.pf-card { margin: 0; }
.pf-card img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border: 1px solid var(--grid-soft); background: #fff; }
.pf-card figcaption { margin-top: 8px; font-weight: 600; }
.pager { display: flex; gap: 16px; }

.showcase-opt { padding: 12px 14px; border: 1px solid var(--grid); border-radius: 4px; background: var(--sheet); }
.pay-total { font-size: 1.05rem; margin: 0; }
.pay-total strong { font-size: 1.35rem; }

/* 사진 */
.photo { margin: 0; }
.photo img { width: 100%; height: auto; border-radius: 4px; }
.photo figcaption { margin-top: 8px; color: var(--ink-soft); font-size: 0.95rem; }
.steps-layout { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.steps-layout .steps { grid-template-columns: 1fr; gap: 22px; }
.steps-layout h2 { margin-top: 0; }
.uses { margin-top: 64px; }
.uses-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 760px) {
  .steps-layout, .uses-grid { grid-template-columns: 1fr; gap: 20px; }
}


/* ───── 차분한 Claude 풍 다듬기 ───── */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.015em; }
h1:not(.hand) { font-size: clamp(2rem, 4.2vw, 2.9rem); line-height: 1.25; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.85rem); }
.lead { font-size: 1.12rem; line-height: 1.75; }

.site-head { background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; border-bottom-color: var(--grid-soft); }
.brand { font-family: var(--serif); font-weight: 600; }
.brand-cell { border-radius: 6px; border-color: var(--green); color: var(--green); }
.top-nav a { padding: 6px 10px; border-radius: 999px; transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
.top-nav a:hover, .top-nav a[aria-current="page"] { background: var(--sheet); text-decoration: none; }

.btn { border-radius: 10px; transition: transform 0.15s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.btn:hover { filter: none; transform: translateY(-1px); box-shadow: 0 4px 14px rgb(196 97 63 / 0.22); }
.btn:active { transform: translateY(0); }
.btn.ghost { border-color: var(--grid); color: var(--ink); background: var(--card); }
.btn.ghost:hover { border-color: var(--ink-faint); box-shadow: none; }

.hero { padding: 72px 0 56px; }
.hero-demo { background: var(--card); border: 1px solid var(--grid-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.gcell { border-color: var(--grid); }
.demo-input, .field input, .field select, .preview-text { border-radius: var(--radius-sm); border-color: var(--grid); background: var(--card); }
.demo-input:focus, .field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgb(196 97 63 / 0.15); }

.step-cell { border-radius: 10px; border-color: var(--grid); background: var(--card); color: var(--green); }
.photo img, .pf-card img { border-radius: var(--radius); box-shadow: var(--shadow); border: 0; }
.price-band > div { border: 1px solid var(--grid-soft); border-radius: var(--radius); background: var(--card); padding: 36px; box-shadow: var(--shadow); }
.price { font-family: var(--serif); }
.checks li::before { border-color: var(--green); }

.faq details { border-bottom: 1px solid var(--grid-soft); }
.faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--ink-faint); transition: transform 0.25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details[open] p { animation: rise 0.35s var(--ease); }

.notice { border-radius: var(--radius-sm); border-left-width: 3px; }
.sheet, .pay-box { border-radius: var(--radius); }
.cells { border-radius: var(--radius-sm); overflow: hidden; }
dialog { border-radius: var(--radius); box-shadow: var(--shadow); }
dialog[open] { animation: rise 0.25s var(--ease); }
.site-foot { background: var(--sheet); border-top: 0; }

/* 한 번의 장면: 손글씨 제목이 한 글자씩 써지듯 나타난다 */
.writein .ch { display: inline-block; clip-path: inset(0 100% 0 0); animation: writein 0.55s var(--ease) forwards; animation-delay: calc(var(--i) * 70ms + 150ms); }
.writein .sp { display: inline-block; width: 0.35em; }
@keyframes writein { to { clip-path: inset(0 0 0 0); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.hero-copy > :not(h1) { animation: rise 0.6s var(--ease) both; animation-delay: 0.9s; }
.hero-demo { animation: rise 0.7s var(--ease) both; animation-delay: 1.1s; }

@media (prefers-reduced-motion: reduce) {
  .writein .ch { clip-path: none; animation: none; }
  .hero-copy > :not(h1), .hero-demo { animation: none; }
}
.price-band h2 { margin-top: 0; }
.glyphs { border-radius: var(--radius-sm); background: var(--card); }
.glyphs button:hover { background: var(--sheet); }
.notice.key { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 20px; }
#job-app h1 { margin-top: 0.6em; }
.photo-examples { margin: 20px 0 8px; }
.photo-examples .ok { color: var(--green); }
.photo-examples .bad { color: var(--danger); }

[hidden] { display: none !important; }
