/* qrcode.typrun.com — Sarang Factory house style (homepage system)
   tokens: bg #F5F6F4 / ink #141518 / pink #E63A58 (gradient F5556E→E63A58) / hairline #DDDFDA
   display type: Exo 2 800 italic, gradient-clipped — same treatment as kioskprogram homepage */

@font-face {
  font-family: "Exo 2";
  src: url("/assets/fonts/exo2-800italic.woff2") format("woff2");
  font-weight: 800;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #F5F6F4;
  --ink: #141518;
  --ink-soft: #4A4D52;
  --pink: #E63A58;
  --pink-hot: #F5556E;
  --pink-deep: #C92847;
  --grad-display: linear-gradient(92deg, #F5556E 0%, #E63A58 100%);
  --hairline: #DDDFDA;
  --card: #FFFFFF;
  --danger: #A33B2E;
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 720px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px 48px;
}

a { color: var(--pink-deep); text-underline-offset: 3px; }
a:hover { color: var(--pink); }

/* display type — Exo 2 gradient headline */
.display {
  font-family: "Exo 2", "Segoe UI", sans-serif;
  font-style: italic;
  font-weight: 800;
  letter-spacing: -0.015em;
  background: var(--grad-display);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- 헤더 ---------- */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0 14px;
  border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand-name {
  font-family: "Exo 2", "Segoe UI", sans-serif;
  font-style: italic;
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand-domain { font-size: 13px; color: var(--ink-soft); }
.header-nav a { font-size: 14px; color: var(--ink-soft); text-decoration: none; }
.header-nav a:hover { color: var(--pink-deep); text-decoration: underline; }

/* ---------- 히어로 (홈페이지 문법: 아이브로우 + Exo2 그라디언트 + 리드) ---------- */
.hero {
  text-align: center;
  padding: 34px 8px 30px;
  border-bottom: 1px dashed var(--hairline);
}
.hero-eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero h1 {
  margin: 0;
  font-size: clamp(34px, 7.2vw, 54px);
  line-height: 1.12;
  padding-right: 0.06em; /* 이탤릭 클리핑 보정 */
}
.hero-lead {
  margin: 14px auto 0;
  max-width: 540px;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ---------- 광고 슬롯 (AdSense 전용 — min-height 예약, 하우스 모드에선 hidden) ---------- */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
}
.ad-slot--b { min-height: 280px; }
.ad-slot--inline { min-height: 100px; }
.ad-slot[hidden] { display: none; } /* hidden 속성이 display:flex에 지지 않도록 */
.ad-slot ins.adsbygoogle { display: block; width: 100%; }

/* ---------- 카드 공통 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}
.card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card-label::before {
  content: "";
  width: 14px;
  height: 2px;
  background: var(--pink);
}

/* ---------- 입력 카드 ---------- */
textarea#qr-input {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  resize: vertical;
}
textarea#qr-input:focus,
input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 1px;
}

details.options { margin-top: 12px; border-top: 1px solid var(--hairline); }
details.options > summary {
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
details.options > summary::-webkit-details-marker { display: none; }
details.options > summary::after { content: " +"; color: var(--pink); }
details.options[open] > summary::after { content: " −"; }

.opt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  padding: 4px 0 8px;
}
.opt { display: flex; flex-direction: column; gap: 4px; }
.opt label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.opt select, .opt input[type="number"], .opt input[type="text"] {
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  min-width: 0;
}
.opt input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 2px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
}
.opt-check { flex-direction: row; align-items: center; gap: 8px; }
.opt-check input { width: 16px; height: 16px; accent-color: var(--pink); }
.opt-check label { font-weight: 500; color: var(--ink); font-size: 14px; }

/* ---------- 미리보기 카드 ---------- */
.preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: repeating-conic-gradient(#ECEDEA 0% 25%, #FFFFFF 0% 50%) 0 0 / 20px 20px;
  padding: 16px;
}
.preview-stage svg { max-width: 240px; width: 100%; height: auto; display: block; }
.preview-empty { font-size: 14px; color: var(--ink-soft); text-align: center; padding: 24px 0; }

.status-line {
  min-height: 22px;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.status-line.is-error { color: var(--danger); font-weight: 600; }

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.btn {
  appearance: none;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 16px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 80ms ease;
}
.btn:hover:not(:disabled) { border-color: var(--pink); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn--primary {
  background: var(--pink);
  border-color: var(--pink);
  color: #FFFFFF;
}
.btn--primary:hover:not(:disabled) { background: var(--pink-deep); border-color: var(--pink-deep); }
.btn-split { display: inline-flex; align-items: stretch; }
.btn-split .btn { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split select {
  border: 1px solid var(--hairline);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--card);
  color: var(--ink-soft);
  font: inherit;
  font-size: 13px;
  padding: 0 8px;
  cursor: pointer;
}
.action-note { font-size: 12px; color: var(--ink-soft); margin: 8px 0 0; }

/* ---------- 히스토리 ---------- */
.history-head { display: flex; align-items: baseline; justify-content: space-between; }
.history-head .btn-text {
  appearance: none; border: 0; background: none;
  font-size: 13px; color: var(--ink-soft); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; padding: 4px;
}
.history-head .btn-text:hover { color: var(--danger); }
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.history-item {
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  padding: 8px;
  cursor: pointer;
  transition: border-color 120ms ease;
}
.history-item:hover, .history-item:focus-visible { border-color: var(--pink); }
.history-item svg { display: block; width: 100%; height: auto; }
.history-item .hist-caption {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-item .hist-del {
  position: absolute;
  top: -7px; right: -7px;
  width: 20px; height: 20px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.history-item .hist-del:hover { color: var(--danger); border-color: var(--danger); }
.history-empty { font-size: 14px; color: var(--ink-soft); }
.history-note { font-size: 12px; color: var(--ink-soft); margin: 12px 0 0; }

/* ---------- FAQ ---------- */
.faq-list { border-top: 1px solid var(--hairline); }
.faq-list details { border-bottom: 1px solid var(--hairline); }
.faq-list summary {
  padding: 14px 4px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before { content: "Q. "; color: var(--pink); font-weight: 800; }
.faq-list .faq-a { padding: 0 4px 16px; font-size: 14px; color: var(--ink-soft); }

/* ---------- 섹션 제목 (Exo 2 solid) ---------- */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 32px 0 8px;
  font-family: "Exo 2", "Segoe UI", sans-serif;
  font-style: italic;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-title .no { font-size: 12px; color: var(--pink); }

/* ---------- 최하단 하우스 배너 (소형, HTML — 모바일에서도 가독) ---------- */
.house-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 40px 0 0;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 13px;
  color: var(--ink-soft);
  transition: border-color 120ms ease;
}
.house-bottom:hover { border-color: var(--pink); color: var(--ink-soft); }
.hb-mark {
  flex: none;
  width: 4px;
  height: 28px;
  border-radius: 2px;
  background: var(--grad-display);
}
.hb-text { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.hb-brand { color: var(--ink); }
.hb-brand strong { font-size: 14px; }
.hb-tagline { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-domain { margin-left: auto; flex: none; font-weight: 700; color: var(--pink); }
@media (max-width: 520px) {
  .hb-domain { display: none; }
}

/* ---------- 푸터 ---------- */
.site-footer {
  margin-top: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--ink-soft);
}
.site-footer .foot-links { display: flex; flex-wrap: wrap; gap: 6px 0; padding: 0; margin: 0 0 8px; list-style: none; }
.site-footer .foot-links li:not(:first-child)::before { content: "·"; margin: 0 8px; color: var(--hairline); }
.site-footer .foot-links a { color: var(--ink-soft); text-decoration: none; }
.site-footer .foot-links a:hover { color: var(--pink-deep); text-decoration: underline; }

/* ---------- 문서 페이지 (guide / privacy) ---------- */
.doc h1 {
  font-size: clamp(28px, 5vw, 36px);
  margin: 30px 0 6px;
  padding-right: 0.06em;
}
.doc .doc-lead { font-size: 15px; color: var(--ink-soft); margin: 0 0 24px; }
.doc h2 {
  display: flex; align-items: baseline; gap: 10px;
  font-family: "Exo 2", "Segoe UI", sans-serif;
  font-style: italic;
  font-weight: 800;
  font-size: 20px;
  margin: 36px 0 10px;
  letter-spacing: -0.01em;
}
.doc h2 .no { font-size: 12px; color: var(--pink); }
.doc p, .doc li { font-size: 15px; color: var(--ink); }
.doc ul { padding-left: 20px; }
.doc .back-to-tool {
  display: inline-block;
  margin-top: 28px;
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 480px) {
  .opt-grid { grid-template-columns: 1fr; }
  .action-row .btn, .action-row .btn-split { flex: 1 1 100%; }
  .btn-split .btn { flex: 1; }
}
