:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #1f1b16;
  --muted: #6b6259;
  --line: #e7e1d8;
  --accent: #b4531c;
  --accent-ink: #ffffff;
  --accent-soft: #fbeee4;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(31 27 22 / 6%), 0 4px 16px rgb(31 27 22 / 5%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161412;
    --surface: #1f1c19;
    --ink: #f1ece6;
    --muted: #a59b90;
    --line: #34302b;
    --accent: #f08a4b;
    --accent-ink: #1a0f08;
    --accent-soft: #3a2619;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.01em; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 48px; }
section { margin: 40px 0; }
.section-title { font-size: 1.15rem; margin: 0 0 14px; color: var(--muted); font-weight: 600; }

.draft-bar {
  background: repeating-linear-gradient(45deg, #fde68a, #fde68a 10px, #fcd34d 10px, #fcd34d 20px);
  color: #422006; text-align: center; font-size: 13px; font-weight: 600; padding: 4px;
}

/* 머리글 · 바닥글 */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.wordmark { font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.site-header nav a { color: var(--muted); text-decoration: none; margin-left: 18px; font-size: 15px; }
.site-header nav a:hover { color: var(--ink); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 24px 0 40px; }
.site-footer p { margin: 4px 0; }

/* 광고 자리: 높이를 미리 잡아 화면이 밀리지 않게 합니다 */
.ad { max-width: 960px; margin: 16px auto; padding: 0 16px; min-height: 90px; }
.ad-draft {
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px;
  margin-left: 16px; margin-right: 16px;
}
@media (min-width: 993px) { .ad-draft { margin-left: auto; margin-right: auto; max-width: 928px; } }

/* 허브 */
.hero { margin: 48px 0 24px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 12px; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 0; max-width: 40em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  display: flex; gap: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); color: inherit; text-decoration: none;
  transition: border-color .15s, transform .15s;
}

.card h3 { margin: 2px 0 2px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.app-icon { border-radius: 22%; flex: none; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.chips { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }

/* 제품 */
.product-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; margin-top: 36px; }
.product-hero h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.name-en { margin: 0; color: var(--muted); font-size: 15px; }
.app-icon-lg { width: 112px; height: 112px; }
.qr { margin: 0; text-align: center; }
.qr svg { display: block; width: 100%; height: auto; border-radius: 8px; }
.qr figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.qr-main { width: 168px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

.stores { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.store {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.store.picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.store-head { display: flex; align-items: center; gap: 10px; }
.store-head div { display: flex; flex-direction: column; line-height: 1.35; flex: 1; }
.store-head span:not(.glyph) { font-size: 13px; color: var(--muted); }
.glyph svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); display: block; }
.pick-badge { position: absolute; top: -10px; right: 12px; font-style: normal; font-size: 11px; font-weight: 600; color: var(--accent-ink); background: var(--accent); padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.store .qr { width: 132px; align-self: center; }
.store-soon { opacity: .6; }

.btn {
  display: block; text-align: center; padding: 10px 14px; border-radius: 10px; font-weight: 600;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
}
.btn:hover { filter: brightness(1.05); }
.btn-disabled { background: var(--line); color: var(--muted); }

.features { padding-left: 1.2em; }
.features li { margin: 4px 0; }
.note { font-size: 14px; color: var(--muted); }
.shots { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.shots img { height: 420px; width: auto; border-radius: 12px; border: 1px solid var(--line); scroll-snap-align: start; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--muted); }
.links { font-size: 14px; }

/* 문서 · 이동 */
.doc { max-width: 720px; margin: 32px auto 0; }
.doc h1 { font-size: 1.6rem; }
.doc h2 { font-size: 1.1rem; margin-top: 28px; }
.doc .meta { color: var(--muted); font-size: 14px; }
.crumb { font-size: 14px; margin: 0; }
.todo { background: #fef3c7; color: #422006; border: 1px solid #f59e0b; border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.redirect { text-align: center; margin: 64px auto; max-width: 420px; }
.plain { list-style: none; padding: 0; }
.plain li { margin: 6px 0; }

/* 휴대폰: QR은 숨기고 버튼 위주로 */
@media (hover: none) and (pointer: coarse) {
  .store .qr, .qr-main { display: none; }
}
@media (max-width: 640px) {
  .product-hero { grid-template-columns: auto 1fr; }
  .qr-main { display: none; }
  .app-icon-lg { width: 80px; height: 80px; }
  .shots img { height: 340px; }
  .ad { min-height: 60px; }
}
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }

/* 받기: 스토어 공식 배지 (스토어별 QR 없음, 대표 QR만 상단에) */
.stores { display: flex; flex-wrap: wrap; gap: 22px 18px; grid-template-columns: none; }
.store { background: none; border: 0; padding: 0; gap: 6px; align-items: flex-start; }
.store.picked { box-shadow: none; }
.store .pick-badge { position: static; align-self: flex-start; }
.badge-link { display: block; line-height: 0; border-radius: 8px; }
.badge-link img { height: 48px; width: auto; display: block; }
.store.picked .badge-link, .store.picked .store-btn { outline: 2px solid var(--accent); outline-offset: 3px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: 9px;
  background: #000; color: #fff; text-decoration: none; font-weight: 600; font-size: 15px; border: 1px solid #a6a6a6;
}
.store-btn .glyph svg { width: 22px; height: 22px; color: #fff; }
.store-btn-disabled { background: var(--line); color: var(--muted); border-color: var(--line); }
.store-meta { font-size: 12px; color: var(--muted); }
.stores { padding-top: 14px; }
.store { position: relative; }
.store .pick-badge { position: absolute; top: -24px; left: 0; right: auto; }

/* 카드: 제품 정보 / 웹 버전 버튼 */
.card > div { display: flex; flex-direction: column; flex: 1; }
.card-actions { display: flex; gap: 8px; margin: auto 0 0 !important; padding-top: 14px; }
.btn-sm {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 9px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--line); color: var(--ink); background: var(--bg);
}
.btn-sm:hover { border-color: var(--accent); }
.btn-sm-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-sm-primary:hover { filter: brightness(1.06); }

/* 하중-압력 계산기 */
.tool-head { display: flex; gap: 16px; align-items: center; margin: 32px 0 20px; }
.tool-head h1 { margin: 0; font-size: clamp(1.5rem, 4vw, 2rem); }
.calc { display: grid; gap: 16px; max-width: 640px; }
.calc-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 18px 18px; margin: 0; }
.calc-group legend { font-weight: 700; padding: 0 6px; color: var(--muted); font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 8px 16px; font-size: 15px; cursor: pointer; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.calc .row { display: flex; align-items: flex-end; gap: 10px; }
.calc .row[hidden] { display: none; }
.field { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 13px; color: var(--muted); gap: 4px; }
.field input, .field output, .calc select {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-height: 46px;
}
.field input { width: 100%; }
.field input:focus, .calc select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.calc select { padding-right: 8px; flex: none; }
.result output { display: block; font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; background: var(--accent-soft); border-color: transparent; }
.times { padding-bottom: 12px; color: var(--muted); }
.arrow { text-align: center; color: var(--muted); font-size: 22px; margin: 8px 0; }
.area { margin: 10px 0 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.explain { max-width: 720px; }
