/* ==========================================================================
   SignPix 스타일시트
   -----------------------------------------------------------------------
   유지보수 가이드
   1) 색상/폰트/간격 등은 전부 :root 변수(디자인 토큰)로 관리합니다.
      브랜드 컬러를 바꾸고 싶다면 아래 :root 블록만 수정하면 됩니다.
   2) 섹션별로 주석을 달아 구분해두었습니다. Ctrl+F로 섹션명을 검색하세요.
   3) 컴포넌트 클래스는 BEM과 유사한 네이밍(.card, .card__title 등)을 사용합니다.
   ========================================================================== */

/* -------------------------------------------------------------------- */
/* 1. 디자인 토큰 (Design Tokens)                                        */
/* -------------------------------------------------------------------- */
:root {
  /* 색상: "잉크와 종이"를 모티브로 한 연보라 팔레트 */
  --ink-900: #1a1723;        /* 본문 텍스트 / 가장 진한 잉크 */
  --ink-700: #554f6a;        /* 보조 텍스트 */
  --ink-400: #928da3;        /* 옅은 텍스트, placeholder */
  --paper-0: #ffffff;        /* 카드/도구 배경 */
  --paper-50: #f7f5fc;       /* 페이지 배경 */
  --paper-100: #efe9f7;      /* 은은한 구획 배경 */
  --accent-primary: #6c5ce0;       /* 주요 액션(연보라 잉크) */
  --accent-primary-dark: #5644c0;
  --accent-secondary: #9b3e8f;     /* 보조 액션(자주/플럼) */
  --accent-secondary-dark: #7c3072;
  --line: #e7e1f2;           /* 헤어라인 구분선 */
  --danger: #c23b3b;

  /* 타이포그래피 */
  --font-body: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  --font-signature: "Alex Brush", "Brush Script MT", cursive;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* 간격 & 형태 */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-tool: 0 20px 50px -25px rgba(26, 23, 35, 0.35);
  --shadow-card: 0 8px 24px -16px rgba(26, 23, 35, 0.25);
  --container: 1080px;

  /* 투명 배경 미리보기용 체크무늬 */
  --checker-a: #ffffff;
  --checker-b: #ede7f6;
}

/* -------------------------------------------------------------------- */
/* 2. 리셋 & 기본 스타일                                                 */
/* -------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--paper-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-primary); text-decoration-thickness: 1.5px; }
a:hover { color: var(--accent-primary-dark); }

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1em; color: var(--ink-700); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

:focus-visible {
  outline: 3px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink-900);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* -------------------------------------------------------------------- */
/* 3. 헤더 / 내비게이션                                                  */
/* -------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 245, 247, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-signature);
  font-size: 28px;
  color: var(--ink-900);
  text-decoration: none;
}
.brand:hover { color: var(--accent-primary); }
.brand__dot { color: var(--accent-secondary); }

.nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav a {
  color: var(--ink-700);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
}
.nav a:hover, .nav a[aria-current="page"] {
  color: var(--accent-primary);
  background: var(--paper-100);
}

/* -------------------------------------------------------------------- */
/* 4. 히어로 섹션                                                        */
/* -------------------------------------------------------------------- */
.hero {
  padding: 56px 0 28px;
  position: relative;
  overflow: hidden;
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-secondary-dark);
  background: #f5e9f2;
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 14px;
}
.hero h1 .highlight {
  /*font-family: var(--font-signature);*/
  color: var(--accent-primary);
  font-size: 1.15em;
  font-weight: 400;
}
.hero__desc {
  font-size: 17px;
  max-width: 46ch;
}
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 18px;
  padding: 0;
  list-style: none;
}
.hero__trust li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-700);
}
.hero__trust li::before {
  content: "✓";
  color: var(--accent-secondary);
  font-weight: 900;
}

.hero__signature-lines {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-signature);
  line-height: 1.05;
}
.hero__signature-lines .line {
  position: relative;
  display: inline-block;
  width: fit-content;
}
.hero__signature-lines .line--sub {
  font-size: clamp(20px, 2.6vw, 28px);
  color: var(--ink-700);
  padding-left: 4px;
}
.hero__signature-lines .line--main {
  font-size: clamp(56px, 8vw, 92px);
  color: var(--accent-primary);
  filter: drop-shadow(0 8px 18px rgba(108, 92, 224, 0.28));
}

/* 텍스트를 왼쪽에서 오른쪽으로 잘라내며 드러내 "펜으로 쓰는" 느낌을 만듭니다 */
.hero__signature-lines .line {
  clip-path: inset(0 100% 0 0);
  animation: signature-reveal 1.1s cubic-bezier(.65,0,.35,1) forwards;
}
.hero__signature-lines .line--sub { animation-delay: 0.15s; }
.hero__signature-lines .line--main { animation-delay: 1.05s; animation-duration: 1.3s; }

/* 텍스트 끝을 따라가는 펜 촉 */
.hero__signature-lines .line::after {
  content: "";
  position: absolute;
  top: 12%;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  animation: signature-pen-tip 1.1s cubic-bezier(.65,0,.35,1) forwards;
}
.hero__signature-lines .line--sub::after { animation-delay: 0.15s; }
.hero__signature-lines .line--main::after {
  width: 14px; height: 14px;
  animation-delay: 1.05s;
  animation-duration: 1.3s;
}

@keyframes signature-reveal {
  to { clip-path: inset(0 0 0 0); }
}
@keyframes signature-pen-tip {
  0% { left: 0%; opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero__signature-lines .line { clip-path: inset(0 0 0 0); animation: none; }
  .hero__signature-lines .line::after { display: none; }
}

/* -------------------------------------------------------------------- */
/* 5. 서명 도구 (핵심 기능 영역)                                          */
/* -------------------------------------------------------------------- */
.tool {
  padding: 12px 0 60px;
}

.tool-card {
  background: var(--paper-0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-tool);
  padding: 22px;
  border: 1px solid var(--line);
}

.tool-card__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-700);
  display: flex;
  align-items: center;
  gap: 6px;
}

input[type="color"] {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: none;
  cursor: pointer;
}

input[type="range"] {
  width: 110px;
  accent-color: var(--accent-primary);
}

.swatches {
  display: flex;
  gap: 6px;
}
.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--paper-0);
  outline: 1px solid var(--line);
  cursor: pointer;
  padding: 0;
}
.swatch[aria-pressed="true"] {
  outline: 2px solid var(--accent-primary);
  outline-offset: 1px;
}

.canvas-stage {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px dashed var(--ink-400);
  background-image:
    linear-gradient(45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(-45deg, var(--checker-b) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--checker-b) 75%),
    linear-gradient(-45deg, transparent 75%, var(--checker-b) 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0px;
  background-color: var(--checker-a);
  touch-action: none;
  aspect-ratio: 16 / 9;
  min-height: 260px;
}
.canvas-stage.is-dark-preview {
  background-color: #1a1a1a;
  background-image: none;
}
.canvas-stage.is-white-preview {
  background-color: #ffffff;
  background-image: none;
}

#signature-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-400);
  /*font-family: var(--font-signature);*/
  font-size: 26px;
  pointer-events: none;
  text-align: center;
  padding: 0 20px;
  transition: opacity 0.2s ease;
}
.canvas-placeholder small {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
}
.canvas-stage.has-content .canvas-placeholder { opacity: 0; }

.tool-card__preview-toggle {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.chip {
  border: 1px solid var(--line);
  background: var(--paper-0);
  color: var(--ink-700);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--ink-900);
  color: #fff;
  border-color: var(--ink-900);
}

.tool-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(47, 85, 212, 0.6);
}
.btn--primary:hover { background: var(--accent-primary-dark); }

.btn--secondary {
  background: var(--accent-secondary);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(14, 128, 116, 0.55);
}
.btn--secondary:hover { background: var(--accent-secondary-dark); }

.btn--ghost {
  background: var(--paper-100);
  color: var(--ink-900);
}
.btn--ghost:hover { background: var(--line); }

.btn--danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid var(--danger);
}
.btn--danger-outline:hover { background: #fbeaea; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.tool-card__hint {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-400);
}

/* -------------------------------------------------------------------- */
/* 6. 섹션 공통                                                          */
/* -------------------------------------------------------------------- */
.section {
  padding: 56px 0;
}
.section--muted {
  background: var(--paper-100);
}
.section__head {
  max-width: 640px;
  margin: 0 auto 36px;
  text-align: center;
}
.section__eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
  font-weight: 700;
  display: block;
  margin-bottom: 10px;
}
.section h2 {
  font-size: clamp(24px, 3vw, 32px);
}

/* 카드 그리드 (기능 소개) */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  background: var(--paper-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.card__icon {
  font-size: 26px;
  margin-bottom: 12px;
}
.card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}
.card p { font-size: 14.5px; margin-bottom: 0; }

/* 이용 방법 (순서가 있는 단계이므로 번호 사용) */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  counter-reset: step;
}
.step {
  position: relative;
  padding: 26px 20px 20px;
  background: var(--paper-0);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-primary);
  font-size: 13px;
  display: inline-block;
  margin-bottom: 10px;
}
.step h3 { font-size: 16px; }
.step p { font-size: 14.5px; margin-bottom: 0; }

/* FAQ (네이티브 details/summary 사용 - JS 불필요) */
.faq {
  max-width: 760px;
  margin: 0 auto;
}
.faq details {
  background: var(--paper-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15.5px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 20px;
  color: var(--accent-primary);
  transition: transform 0.15s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 10px 0 0; font-size: 14.5px; }

/* CTA 배너 */
.cta-banner {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-dark));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  text-align: center;
}
.cta-banner h2 { color: #fff; }
.cta-banner p { color: rgba(255,255,255,0.85); }
.cta-banner .btn--primary {
  background: #fff;
  color: var(--accent-primary-dark);
  box-shadow: none;
}
.cta-banner .btn--primary:hover { background: #f0ecfb; }

/* -------------------------------------------------------------------- */
/* 7. 콘텐츠 페이지 (소개 / 개인정보처리방침)                             */
/* -------------------------------------------------------------------- */
.content-page {
  padding: 48px 0 72px;
}
.content-page__header {
  max-width: 760px;
  margin: 0 auto 32px;
}
.content-page__header p { font-size: 16px; }
.prose {
  max-width: 760px;
  margin: 0 auto;
  background: var(--paper-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
}
.prose h2 {
  font-size: 20px;
  margin-top: 34px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.prose h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.prose h3 { font-size: 16px; margin-top: 20px; }
.prose ul, .prose ol { color: var(--ink-700); padding-left: 1.3em; }
.prose li { margin-bottom: 6px; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 14px 0;
}
.prose th, .prose td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.prose th { background: var(--paper-100); }
.updated-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--paper-100);
  color: var(--ink-700);
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 4px;
}

/* -------------------------------------------------------------------- */
/* 8. 푸터                                                               */
/* -------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0;
  background: var(--paper-0);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.site-footer__links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer__links a {
  color: var(--ink-700);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.site-footer__links a:hover { color: var(--accent-primary); }
.site-footer__copy {
  font-size: 13px;
  color: var(--ink-400);
}

/* -------------------------------------------------------------------- */
/* 9. 토스트 알림                                                        */
/* -------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink-900);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.4);
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* -------------------------------------------------------------------- */
/* 10. 반응형 (태블릿 / 모바일)                                          */
/* -------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__signature-lines { align-items: center; margin: 0 auto; }
  .hero__signature-lines .line { margin: 0 auto; }
  .grid, .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .site-header__inner { padding: 12px 16px; }
  .nav { gap: 0; }
  .nav a { padding: 8px 10px; font-size: 14px; }
  .hero { padding: 34px 0 16px; }
  .grid, .steps { grid-template-columns: 1fr; }
  .tool-card { padding: 16px; }
  .tool-card__toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-group { justify-content: space-between; }
  .tool-card__actions .btn { flex: 1 1 auto; justify-content: center; }
  .prose { padding: 22px; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; }
}

/* 큰 태블릿(아이패드) 가로모드에서 캔버스 비율 최적화 */
@media (min-width: 641px) and (max-width: 1080px) {
  .canvas-stage { aspect-ratio: 16 / 7; }
}
