@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #17202a;
  --muted: #5b6673;
  --line: #e3e7ec;
  --brand: #1f6f5c;
  --brand-soft: #e6f2ee;
  --accent: #d9822b;
  --ok: #1f7a4d;
  --ok-soft: #e7f5ec;
  --no: #b3402f;
  --no-soft: #fbecea;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  word-break: keep-all;
}
a { color: var(--brand); }
img { max-width: 100%; }

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

/* header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo { font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--brand); }
.nav { display: flex; gap: 16px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--brand); }

/* hero */
.hero { padding: 36px 0 12px; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 3px 10px; border-radius: 999px; }
h1 { font-size: 28px; line-height: 1.35; margin: 12px 0 8px; letter-spacing: -0.03em; }
.lead { color: var(--muted); margin: 0; }
h2 { font-size: 21px; margin: 40px 0 12px; letter-spacing: -0.02em; }
h3 { font-size: 17px; margin: 24px 0 8px; }

/* card */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 20px 0; }
.tool-list { display: grid; gap: 14px; margin: 20px 0; }
.tool-link { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; }
.tool-link:hover { border-color: var(--brand); transform: translateY(-1px); }
.tool-link strong { display: block; font-size: 18px; margin-bottom: 4px; }
.tool-link span { color: var(--muted); font-size: 15px; }
.tool-link .tag, .tag { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent) !important; margin-bottom: 6px; }

/* form */
.field { margin-bottom: 18px; }
.field > label, .field > .label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 15px; }
.hint { display: block; font-size: 13px; color: var(--muted); font-weight: 400; margin-top: 4px; }
input[type="number"], select {
  width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
input[type="number"]:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.input-unit { position: relative; }
.input-unit input { padding-right: 56px; }
.input-unit em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 15px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { flex: 1 1 120px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: pointer; font-size: 15px; background: #fff; }
.choices input { accent-color: var(--brand); }
.choices label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.btn { display: block; width: 100%; font: inherit; font-weight: 700; font-size: 17px; padding: 14px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
[hidden] { display: none !important; }

/* result */
.result { border-radius: var(--radius); padding: 22px; margin-top: 20px; border: 1px solid var(--line); background: var(--card); }
.result.ok { background: var(--ok-soft); border-color: #bfe3cc; }
.result.no { background: var(--no-soft); border-color: #f0c9c3; }
.result .verdict { font-weight: 800; font-size: 15px; }
.result.ok .verdict { color: var(--ok); }
.result.no .verdict { color: var(--no); }
.result .big { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; margin: 4px 0; }
.result .sub { color: var(--muted); font-size: 14px; margin: 0; }
.meter { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 14px 0 6px; }
.meter > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--card); }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { background: #f0f3f5; font-size: 14px; color: var(--muted); }
tr.hit td { background: var(--ok-soft); font-weight: 700; }
tr.miss td { color: var(--muted); }

/* article */
.article p, .article li { color: #2a3440; }
.article ul, .article ol { padding-left: 20px; }
.note { font-size: 14px; color: var(--muted); background: #fff8ee; border: 1px solid #f3dfc2; border-radius: 10px; padding: 12px 14px; margin: 16px 0; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 10px 0; }
summary { font-weight: 700; cursor: pointer; }
details p { margin: 10px 0 0; }

/* ad slot */
.ad-slot { margin: 28px 0; min-height: 0; }

/* footer */
.site-footer { margin-top: 56px; padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); background: var(--card); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.site-footer a { color: var(--muted); }

@media (max-width: 560px) {
  h1 { font-size: 24px; }
  .nav { display: none; }
  .result .big { font-size: 28px; }
}

/* ───────── 퀴즈형 홈 ───────── */
.intro { text-align: center; padding: 48px 0 8px; }
.intro h1 { font-size: clamp(30px, 6vw, 42px); line-height: 1.2; margin: 14px 0 12px; }
.intro .lead { font-size: 17px; }
.btn.big { max-width: 360px; margin: 28px auto 10px; font-size: 19px; padding: 18px; border-radius: 14px; box-shadow: 0 8px 20px rgba(31,111,92,.25); }
.trust { font-size: 13px; color: var(--muted); margin: 0; }
.peek { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 36px 0 8px; }
.peek div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 8px; }
.peek b { display: block; font-size: 19px; color: var(--brand); letter-spacing: -0.02em; }
.peek span { display: block; font-size: 13px; color: var(--muted); line-height: 1.45; margin-top: 4px; }

.quiz { padding: 28px 0 8px; min-height: 60vh; }
.q-top { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.q-back { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 20px; cursor: pointer; color: var(--ink); flex: none; }
.q-bar { flex: 1; height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.q-bar i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 999px; transition: width .35s ease; }
.q-step { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
#stage.in { animation: slideIn .32s ease both; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.q { font-size: clamp(24px, 5vw, 30px); line-height: 1.3; margin: 0 0 6px; letter-spacing: -0.03em; }
.q-sub { color: var(--muted); margin: 0 0 28px; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.opt { font: inherit; font-size: 19px; font-weight: 700; padding: 22px 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; transition: transform .12s, border-color .12s, background .12s; }
.opt:hover { border-color: var(--brand); }
.opt:active { transform: scale(.97); }
.opt.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.slide output { display: block; text-align: center; font-size: clamp(40px, 9vw, 56px); font-weight: 800; letter-spacing: -0.04em; color: var(--brand); font-variant-numeric: tabular-nums; }
.slide-note { text-align: center; color: var(--muted); margin: 0 0 22px; min-height: 1.6em; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 12px; border-radius: 999px; background: linear-gradient(to right, var(--brand) var(--p,0%), var(--line) var(--p,0%)); outline: none; margin: 8px 0 18px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 4px solid var(--brand); box-shadow: 0 2px 8px rgba(0,0,0,.18); cursor: grab; }
input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 4px solid var(--brand); cursor: grab; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 26px; }
.chip { font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }

/* 결과 */
#result { padding-top: 24px; }
.r-hero { text-align: center; background: linear-gradient(160deg, #1f6f5c, #164f42); color: #fff; border-radius: 22px; padding: 34px 20px 30px; box-shadow: 0 14px 30px rgba(22,79,66,.28); animation: pop .45s ease both; }
.r-lead { margin: 0; font-size: 17px; opacity: .9; }
.r-big { margin: 6px 0; font-size: clamp(38px, 10vw, 60px); font-weight: 800; letter-spacing: -0.04em; color: #ffd58a; font-variant-numeric: tabular-nums; }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.rcs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin: 18px 0; }
.rc { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; opacity: .72; animation: up .45s ease both; }
.rc:nth-child(2) { animation-delay: .12s; } .rc:nth-child(3) { animation-delay: .24s; }
.rc.ok, .rc.wide { opacity: 1; }
.rc.ok { border: 2px solid var(--brand); }
.rc.wide { grid-column: 1 / -1; }
@keyframes up { from { opacity: 0; transform: translateY(14px); } }
.rc-tag { font-size: 13px; font-weight: 700; color: var(--muted); }
.rc.ok .rc-tag { color: var(--brand); }
.rc h3 { margin: 2px 0 8px; font-size: 17px; }
.rc-amt { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 8px; }
.rc.ok .rc-amt { color: var(--brand); }
.rc-desc { font-size: 15px; color: #3a4552; margin: 0 0 10px; }
.rc-link { font-size: 14px; font-weight: 700; text-decoration: none; }
.gauge { position: relative; height: 14px; background: var(--line); border-radius: 999px; margin: 8px 0 34px; }
.gauge i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--brand)); animation: grow 1s ease both; }
@keyframes grow { from { width: 0 !important; } }
.gauge span { position: absolute; top: -4px; width: 2px; height: 22px; background: #8a96a3; }
.gauge em { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; }
.r-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.ghost { background: var(--card); color: var(--brand); border: 2px solid var(--brand); }
.r-fine { font-size: 13px; color: var(--muted); text-align: center; margin-top: 14px; }

.small-h { font-size: 18px; margin-top: 44px; }
.tool-list.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.tool-list.three .tool-link { padding: 16px; }
.tool-list.three strong { font-size: 16px; }
.tool-list.three span { font-size: 13px; }
details.more { margin: 28px 0; background: var(--card); }
details.more > summary { padding: 4px 0; color: var(--brand); }
details.more .article h2:first-child { margin-top: 16px; }

@media (max-width: 560px) {
  .rcs { grid-template-columns: 1fr; }
  .tool-list.three { grid-template-columns: 1fr; }
  .peek b { font-size: 16px; }
  .gauge em { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 결과 이미지 저장 */
.btn.save { background: var(--accent); margin-bottom: 10px; box-shadow: 0 6px 16px rgba(217,130,43,.3); }
.card-preview { margin: 18px auto 0; max-width: 360px; text-align: center; }
.card-preview img { width: 100%; border-radius: 16px; box-shadow: 0 10px 26px rgba(0,0,0,.18); }
.card-preview p { font-size: 13px; color: var(--muted); }
