:root {
  /* 인주(도장) 레드 — assets/stamp-watdagam.png에서 실측 추출 */
  --ink: #CE311F;
  --ink-soft: rgba(206, 49, 31, 0.1);
  /* 크래프트지 팔레트 — 앱 themeB(모노/웜톤) 그대로 재사용, 브랜드 일관성 */
  --bg: #EFECE6;
  --surface: #FFFFFF;
  --surface-alt: #F6F3EE;
  --text: #1B1B1A;
  --text-muted: #6B6A63;
  --border: #E6E4DF;
  --accent-on: #FFFFFF;
  /* 스크래치 덮개 (canvas에서 읽어감) */
  --cover: #CFC8BB;
  --cover-line: rgba(0, 0, 0, 0.14);
  --tile-a: #E7DFD0;
  --tile-b: #DCE3D9;
  --tile-c: #EFE6D8;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E2543C;
    --ink-soft: rgba(226, 84, 60, 0.16);
    --bg: #161514;
    --surface: #201F1C;
    --surface-alt: #1B1A18;
    --text: #ECEAE5;
    --text-muted: #98948A;
    --border: #33312C;
    --cover: #35322C;
    --cover-line: rgba(0, 0, 0, 0.4);
    --tile-a: #3B372F;
    --tile-b: #343A35;
    --tile-c: #423C33;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--noise);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard', 'Malgun Gothic', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 0;
}

header.site .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.01em;
}

header.site .brand img { width: 26px; height: 26px; border-radius: 6px; }

header.site nav a {
  margin-left: 18px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}

header.site nav a:hover { color: var(--ink); }

/* ── 히어로: 도장이 "쾅" 찍히고, 옆에서 지도가 긁힌다 ── */
.hero {
  padding-top: 64px;
  padding-bottom: 24px;
}

.hero-lead {
  display: grid;
  gap: 40px;
  align-items: start;
}

.hero .stamp-wrap {
  display: inline-block;
  margin-bottom: 24px;
  animation: stampDown 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
}

.hero .stamp {
  width: 104px;
  height: 104px;
  object-fit: contain;
  transform: rotate(-6deg);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18));
}

@keyframes stampDown {
  0% { opacity: 0; transform: scale(1.9) rotate(-6deg); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: scale(1) rotate(-6deg); }
}

.hero h1 {
  font-size: clamp(34px, 6vw, 48px);
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero p.tagline {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 0 22px;
  max-width: 32ch;
}

.store-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.store-links.center { justify-content: center; }

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--accent-on);
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  box-shadow: 0 4px 14px var(--ink-soft);
}

.store-btn.disabled {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px dashed var(--border);
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

/* '(준비 중)' 라벨이 길어 좁은 히어로 컬럼에서 줄바꿈된다 */
.hero-lead .store-btn { padding: 12px 16px; font-size: 14px; }

/* ── 스크래치 데모 ── */
.demo-stage {
  position: relative;
  max-width: 280px;
  aspect-ratio: 5 / 7;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transform: rotate(1.2deg);
}

.demo-map {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(7, 1fr);
  background: var(--surface-alt);
}

.demo-map b,
.demo-map i {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(10px, 2.4vw, 12px);
  font-weight: 600;
  font-style: normal;
  color: var(--text);
  letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1px var(--bg);
}

.demo-map b { background: var(--tile-a); }
.demo-map b:nth-of-type(3n) { background: var(--tile-b); }
.demo-map b:nth-of-type(4n) { background: var(--tile-c); }
.demo-map .void { background: transparent; box-shadow: none; }

#scratch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  /* 세로 스크롤은 브라우저에 양보하고, 문지르는 동작만 가져온다 */
  touch-action: pan-y;
}

.demo-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--accent-on);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.demo-hint.gone { opacity: 0; }

.demo-note {
  max-width: 280px;
  margin: 20px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* ── 본문 섹션 공통 ── */
.block { margin: 88px auto; }

.block h2, .cta-repeat h2, .pro h2 {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0 0 14px;
}

.block-body {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.75;
}

.sub-head {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 48px 0 10px;
}

.caption {
  font-size: 13px;
  color: var(--text-muted);
  margin: 10px 0 0;
}

/* 비대칭 2컬럼 — 균일한 세로 흐름을 한 번 끊는다 */
.block.split { display: grid; gap: 28px; }

/* TODO: 실기기/시뮬레이터 스크린샷 확보되면 .shot-slot을 <img>로 교체 (각 슬롯의 HTML 주석에 디렉팅 있음) */
.shot-slot {
  aspect-ratio: 9 / 16;
  max-width: 240px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 0 12px;
}

.shot-slot.wide { aspect-ratio: 16 / 10; max-width: 420px; margin: 0 0 8px; }

.shot-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 560px;
}

.shot-strip.two { grid-template-columns: repeat(2, 1fr); max-width: 400px; }

.shot-strip .shot-slot { max-width: none; }

/* ── 도장: 화면 폭을 가득 쓰고 가로로 흐른다 ── */
.badges { margin: 96px 0; padding: 0; }

.badge-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 20px max(20px, calc(50% - 360px));
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.badge-rail::-webkit-scrollbar { display: none; }

.badge-rail img,
.badge-rail .badge-locked {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  scroll-snap-align: center;
}

.badge-rail img { border-radius: var(--radius-sm); }

.badge-rail img:nth-child(even) { transform: rotate(-3deg); }
.badge-rail img:nth-child(3n) { transform: rotate(2.5deg); }

.badge-locked {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 30px;
  font-weight: 800;
  background: var(--surface-alt);
}

/* ── Pro: 종이 한 장이 얹힌 것처럼 ── */
.pro {
  position: relative;
  margin: 96px 0;
  padding: 40px 32px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.price-tag {
  position: absolute;
  top: -14px;
  right: 24px;
  margin: 0;
  padding: 5px 14px;
  background: var(--ink);
  color: var(--accent-on);
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  transform: rotate(3deg);
  box-shadow: 0 4px 12px var(--ink-soft);
}

.pro-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 20px;
  max-width: 440px;
}

.pro-list li {
  font-size: 14px;
  padding-left: 22px;
  position: relative;
}

.pro-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--ink);
  font-weight: 700;
}

.pro .shot-slot { margin-top: 24px; }

/* ── 하단 CTA + 프라이버시 ── */
.cta-repeat {
  text-align: center;
  margin: 96px 0 24px;
  padding: 48px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.cta-repeat .block-body { margin-bottom: 24px; }

.privacy-note {
  max-width: 46ch;
  margin: 0 auto 40px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted);
  text-align: center;
}

footer.site {
  max-width: 720px;
  margin: 40px auto 0;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

footer.site a { color: var(--text-muted); margin: 0 8px; }
footer.site a:hover { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .hero .stamp-wrap { animation: none; }
  .demo-hint { transition: none; }
}

@media (min-width: 760px) {
  .hero-lead {
    grid-template-columns: 1fr 280px;
    gap: 44px;
    padding-top: 80px;
  }
  .block.split { grid-template-columns: 4fr 5fr; gap: 40px; align-items: center; }
}

@media (max-width: 480px) {
  .pro-list { grid-template-columns: 1fr; }
  .pro { padding: 36px 22px 26px; }
  .badge-rail img,
  .badge-rail .badge-locked { width: 88px; height: 88px; }
}

/* ── 법률 문서 페이지: 같은 팔레트, 장식 최소·가독성 우선 ── */
.legal { padding-bottom: 48px; }
.legal h1 {
  font-size: clamp(26px, 5vw, 32px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 44px 0 4px;
}
.legal .meta { color: var(--text-muted); font-size: 13px; margin-bottom: 32px; }
.legal h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 34px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--ink);
}
.legal p, .legal li { font-size: 15px; color: var(--text); }
.legal ul, .legal ol { padding-left: 20px; }
.legal table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.legal table th, .legal table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.legal table th { color: var(--text-muted); font-weight: 600; width: 110px; }
.back-link {
  display: inline-block;
  margin: 20px 0 4px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.back-link:hover { color: var(--ink); }
