/* typeof dev — mobile-first, light & clean */
:root {
  --bg: #ffffff;
  --card: #ffffff;
  --soft: #f5f6f7;
  --line: #e7e9ec;
  --text: #1c1e21;
  --muted: #7a828c;
  --accent: #0d9668;      /* calm green */
  --accent-soft: #e9f7f1;
  --dark: #17181a;        /* primary button */
  --danger: #d6564c;
  --danger-soft: #fdf1f0;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", system-ui, sans-serif;
  line-height: 1.6;
  min-height: 100dvh;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px calc(28px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.mono { font-family: var(--mono); }
.green { color: var(--accent); }
.muted { color: var(--muted); }

/* ---------- landing ---------- */
.landing {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
  text-align: center;
}
.landing h1 {
  font-family: var(--mono);
  font-size: clamp(34px, 10vw, 44px);
  font-weight: 700;
  letter-spacing: -1.5px;
}
.landing h1 .green { color: var(--accent); }
.landing h1 .cursor {
  display: inline-block;
  width: 0.5em;
  height: 1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 5px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.landing .sub {
  font-size: 18px;
  font-weight: 600;
  margin-top: 10px;
}
.landing .desc {
  font-size: 15px;
  color: var(--muted);
  word-break: keep-all;
  line-height: 1.7;
}
.landing .code-line {
  font-family: var(--mono);
  font-size: 14.5px;
  color: var(--muted);
  background: var(--soft);
  border-radius: 12px;
  padding: 14px 16px;
  display: inline-block;
}
.landing .meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
}

/* ---------- buttons ---------- */
.btn {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  padding: 16px 20px;
  cursor: pointer;
  transition: transform 0.06s ease, border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
  text-align: center;
}
.btn:active { transform: scale(0.98); background: var(--soft); }
.btn-primary {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
  font-size: 17px;
  padding: 18px 20px;
}
.btn-primary:active { background: #000; }
.btn-ghost { border-color: transparent; color: var(--muted); font-weight: 500; }
.btn:disabled { opacity: 0.55; cursor: default; }

/* ---------- quiz ---------- */
.quiz-top { padding: 4px 0 18px; }
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.progress-bar {
  height: 6px;
  background: var(--soft);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.25s ease;
}

.question {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  animation: fadeUp 0.22s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.q-text {
  font-size: clamp(19px, 5.4vw, 22px);
  font-weight: 700;
  line-height: 1.5;
  word-break: keep-all;
}
.q-options { display: flex; flex-direction: column; gap: 12px; }
.opt {
  text-align: left;
  font-weight: 500;
  font-size: 15.5px;
  line-height: 1.55;
  padding: 18px;
  word-break: keep-all;
  background: var(--soft);
  border-color: transparent;
}
.opt:active { border-color: var(--accent); background: var(--accent-soft); }
.quiz-bottom { padding-top: 18px; }

/* ---------- result ---------- */
.result { animation: fadeUp 0.3s ease; display: flex; flex-direction: column; gap: 14px; }
.result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 1px 10px rgba(20, 24, 31, 0.04);
}
.result-card .typeline {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
}
.result-card .emoji { font-size: 64px; line-height: 1.2; }
.result-card .code {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 4px;
  margin-top: 8px;
}
.result-card h2 { font-size: 26px; margin-top: 4px; letter-spacing: -0.5px; }
.result-card .quote {
  margin-top: 14px;
  font-size: 15.5px;
  background: var(--soft);
  border-radius: 12px;
  padding: 12px 14px;
  word-break: keep-all;
}
.result-card .quote::before { content: "“"; color: var(--accent); }
.result-card .quote::after { content: "”"; color: var(--accent); }

.section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
}
.section h3 {
  font-size: 13px;
  font-family: var(--mono);
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 12px;
}
.section p { font-size: 15px; word-break: keep-all; }
.tag-row { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.tag { border-radius: 12px; padding: 12px 14px; font-size: 14.5px; word-break: keep-all; }
.tag.good { background: var(--accent-soft); }
.tag.warn { background: var(--danger-soft); }
.tag b { display: block; font-size: 13px; margin-bottom: 3px; }
.tag.good b { color: var(--accent); }
.tag.warn b { color: var(--danger); }

/* axis bars */
.axis { margin-bottom: 14px; }
.axis:last-child { margin-bottom: 0; }
.axis .labels {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  margin-bottom: 5px;
  color: var(--muted);
}
.axis .labels .win { color: var(--accent); font-weight: 700; }
.axis .bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--soft);
}
.axis .bar .left { background: var(--accent); }
.axis .bar .right { background: #ccd2d9; }

/* partners */
.partner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--soft);
  border-radius: 14px;
  padding: 14px;
}
.partner + .partner { margin-top: 10px; }
.partner .p-emoji { font-size: 34px; line-height: 1.3; }
.partner .p-name { font-weight: 700; font-size: 15.5px; }
.p-code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 6px;
  letter-spacing: 2px;
}
.partner .p-text { font-size: 13.5px; color: var(--muted); margin-top: 3px; word-break: keep-all; }
.partner.worst { background: var(--danger-soft); }

.share-row { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.footer-note {
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding-top: 10px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(30px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--dark);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10;
}
.toast.show { opacity: 1; }

/* ---------- 정적 콘텐츠 페이지 (유형 상세 / 목록 / 소개 / 약관) ---------- */
.page-head {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 20px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-head .brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.page-head .head-cta {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.page-head .head-cta:active { background: var(--soft); }

.app.doc { min-height: auto; gap: 14px; padding-top: 8px; }
.app.doc article { display: flex; flex-direction: column; gap: 14px; }
.app.doc .result-card h1 { font-size: 26px; margin-top: 4px; letter-spacing: -0.5px; }
.app.doc .section h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}
.app.doc .section + .section { margin-top: 0; }
.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.7px; padding: 12px 0 2px; }
.page-lead { font-size: 15px; color: var(--muted); word-break: keep-all; margin-bottom: 6px; }

.pole-list, .axis-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.pole-list li { display: flex; gap: 12px; align-items: flex-start; }
.pole-key {
  flex: 0 0 66px;
  text-align: center;
  background: var(--soft);
  border-radius: 10px;
  padding: 8px 4px;
}
.pole-key b { display: block; font-family: var(--mono); font-size: 18px; color: var(--accent); }
.pole-key span { font-size: 10.5px; color: var(--muted); word-break: keep-all; }
.pole-body { flex: 1; }
.pole-body b { font-size: 14.5px; }
.pole-body p { font-size: 14px; color: var(--muted); word-break: keep-all; margin-top: 2px; }

.axis-list li { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.axis-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.axis-name { font-size: 12.5px; color: var(--muted); }
.axis-pair { font-size: 14.5px; font-weight: 600; }
.axis-pair b { color: var(--accent); margin-right: 2px; }

a.partner { text-decoration: none; color: inherit; }
a.partner:active { opacity: 0.7; }

.type-grid { display: flex; flex-direction: column; gap: 10px; }
.type-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  text-decoration: none;
  color: inherit;
}
.type-card:active { background: var(--soft); }
.tc-emoji { font-size: 30px; line-height: 1; }
.tc-body { display: flex; flex-direction: column; min-width: 0; }
.tc-name { font-weight: 700; font-size: 15.5px; }
.tc-quote {
  font-size: 13px;
  color: var(--muted);
  word-break: keep-all;
  margin-top: 2px;
}

.cta-box {
  background: var(--soft);
  border-radius: 18px;
  padding: 22px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.cta-box p { font-weight: 700; font-size: 16px; }
.cta-box .btn { text-decoration: none; }

.page-foot {
  max-width: 480px;
  margin: 0 auto;
  padding: 26px 20px calc(30px + env(safe-area-inset-bottom));
  text-align: center;
  border-top: 1px solid var(--line);
}
.page-foot nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.page-foot nav a { font-size: 13.5px; color: var(--muted); text-decoration: none; }
.page-foot nav a:active { color: var(--text); }
.page-foot p { font-size: 12px; }

/* 본문 텍스트 페이지 (소개/약관) */
.prose h2 { font-size: 17px; font-weight: 700; margin: 22px 0 8px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { font-size: 14.5px; color: #3f454d; word-break: keep-all; }
.prose p { margin-bottom: 10px; }
.prose ul { padding-left: 18px; margin-bottom: 10px; }
.prose li { margin-bottom: 5px; }
.prose .updated { font-size: 13px; color: var(--muted); }

/* 광고 슬롯 */
.ad-slot { display: flex; justify-content: center; min-height: 0; }
.ad-slot:empty { display: none; }
