:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef2ff;
  --good: #059669;
  --bad: #dc2626;
  --gold: #f59e0b;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 8px 24px rgba(17, 24, 39, .06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", "Segoe UI", sans-serif;
  line-height: 1.6;
  word-break: keep-all;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px 48px; }
a { color: var(--brand); }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }

/* ------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-size: 18px; letter-spacing: -.02em; }
.brand b { color: var(--brand); }
.footer { color: var(--muted); font-size: 12px; text-align: center; padding: 24px 16px 40px; border-top: 1px solid var(--line); }
.footer p { margin: 4px auto; max-width: 720px; }

/* ------------------------------------------------ common */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 14px 22px;
  font-weight: 700; font-size: 16px; text-decoration: none;
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 20px rgba(79, 70, 229, .3); }
.btn-primary:hover { box-shadow: 0 10px 28px rgba(79, 70, 229, .4); }
.btn-primary[disabled] { opacity: .6; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: #c7cbd4; }
.btn-lg { padding: 18px 30px; font-size: 18px; border-radius: 14px; }
.btn-block { width: 100%; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .grid-3 { grid-template-columns: 1fr; } }
.section { margin-top: 56px; }
.section-title { text-align: center; font-size: 26px; margin-bottom: 24px; }

/* ------------------------------------------------ landing */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; padding-top: 48px; }
.hero h1 { font-size: 44px; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: #374151; margin: 0 0 24px; }
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; margin: 20px 0 0; color: var(--muted); font-size: 14px; }
.hero-meta span::before { content: "✓ "; color: var(--good); font-weight: 700; }
.hero-visual { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 20px; }
.hero-visual .matrix { max-width: 340px; }
.hero-visual .caption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 10px; }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .hero h1 { font-size: 32px; }
}
.feature .icon { font-size: 28px; }
.feature h3 { font-size: 17px; margin-top: 8px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.steps { counter-reset: step; }
.step { position: relative; padding-left: 52px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 20px; top: 22px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
  display: grid; place-items: center;
}
.step h3 { font-size: 16px; }
.step p { margin: 0; font-size: 14px; color: var(--muted); }
.faq details { background: #fff; border-radius: 12px; padding: 16px 20px; margin-bottom: 10px; box-shadow: var(--shadow); }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 10px 0 0; color: #374151; font-size: 15px; }
.resume-banner { margin-top: 20px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--brand-soft); border-radius: 12px; padding: 12px 16px; }

/* ------------------------------------------------ intro */
.intro { max-width: 640px; margin: 40px auto 0; }
.intro ul { padding-left: 20px; }
.intro li { margin: 6px 0; }
.intro .rules { background: #f9fafb; border-radius: 12px; padding: 16px 20px; margin: 16px 0 24px; }

/* ------------------------------------------------ test */
.test-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 8px; }
.test-head .qno { font-weight: 800; font-size: 18px; }
.test-head .qno span { color: var(--muted); font-weight: 500; font-size: 15px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; padding: 6px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.timer.warn { color: var(--bad); border-color: #fecaca; background: #fef2f2; }
.progress { height: 6px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .3s ease; }
.test-body { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; margin-top: 20px; }
@media (max-width: 760px) { .test-body { grid-template-columns: 1fr; gap: 16px; } }
.matrix {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; background: #fff; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden;
  width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 1;
}
.matrix > div { border-right: 1px solid #d1d5db; border-bottom: 1px solid #d1d5db; display: grid; place-items: center; padding: 6%; }
.matrix > div:nth-child(3n) { border-right: 0; }
.matrix > div:nth-child(n+7) { border-bottom: 0; }
.matrix svg, .option svg { width: 100%; height: 100%; display: block; }
.matrix .missing { background: repeating-linear-gradient(45deg, #f5f3ff, #f5f3ff 8px, #ede9fe 8px, #ede9fe 16px); color: var(--brand); font-size: clamp(28px, 7vw, 44px); font-weight: 800; }
.options-title { font-weight: 700; margin-bottom: 10px; }
.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.option {
  position: relative; aspect-ratio: 1; background: #fff; border: 2px solid var(--line); border-radius: 12px;
  padding: 10%; transition: border-color .15s, box-shadow .15s, transform .08s;
}
.option:hover { border-color: #a5b4fc; }
.option.selected { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, .15); }
.option .num { position: absolute; top: 4px; left: 8px; font-size: 12px; color: var(--muted); font-weight: 700; }
.option.correct { border-color: var(--good); box-shadow: 0 0 0 3px rgba(5, 150, 105, .15); }
.option.wrong { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.test-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; justify-content: center; }
.dots button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 700; color: var(--muted); padding: 0; }
.dots button.done { background: var(--brand-soft); border-color: #c7d2fe; color: var(--brand); }
.dots button.current { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ------------------------------------------------ analyzing */
.analyzing { max-width: 480px; margin: 80px auto 0; text-align: center; }
.spinner { width: 64px; height: 64px; border-radius: 50%; border: 6px solid var(--brand-soft); border-top-color: var(--brand); animation: spin 1s linear infinite; margin: 0 auto 24px; }
@keyframes spin { to { transform: rotate(360deg); } }
.analyzing ol { list-style: none; padding: 0; text-align: left; margin: 24px auto 0; max-width: 320px; }
.analyzing li { padding: 6px 0; color: #9ca3af; transition: color .3s; }
.analyzing li.on { color: var(--ink); }
.analyzing li.on::before { content: "✓ "; color: var(--good); font-weight: 800; }

/* ------------------------------------------------ result */
.result-wrap { max-width: 720px; margin: 32px auto 0; }
.result-hero { text-align: center; padding: 32px 24px; }
.result-hero .rank { font-size: 52px; font-weight: 900; letter-spacing: -.03em; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.15; }
.result-hero .sub { color: #374151; font-size: 17px; }
.bell { width: 100%; height: auto; display: block; margin: 16px 0 4px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.stat { background: #f9fafb; border-radius: 12px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12px; color: var(--muted); }
.locked { position: relative; display: inline-block; }
.preview-list.locked, .stat.locked { display: block; }
.blur { filter: blur(9px); user-select: none; pointer-events: none; }
.lock-badge { position: absolute; inset: 0; display: grid; place-items: center; }
.lock-badge span { background: rgba(17, 24, 39, .85); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.iq-teaser { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 8px 0; }
.iq-teaser .label { font-weight: 700; color: var(--muted); }
.iq-teaser .num { font-size: 64px; font-weight: 900; color: var(--ink); }
.paywall { margin-top: 20px; border: 2px solid #c7d2fe; position: relative; overflow: hidden; }
.paywall::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.paywall h2 { font-size: 22px; }
.benefits { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.benefits li { padding-left: 28px; position: relative; }
.benefits li::before { content: "🔒"; position: absolute; left: 0; }
.price { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 16px; flex-wrap: wrap; }
.price .now { font-size: 32px; font-weight: 900; }
.price .was { color: var(--muted); text-decoration: line-through; }
.price .off { color: var(--bad); font-weight: 800; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 700; }
.field input { font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.field input:focus { outline: 2px solid #c7d2fe; border-color: var(--brand); }
.trust { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--muted); }
.preview-list { display: grid; gap: 10px; margin-top: 12px; }
.bar { display: grid; grid-template-columns: 92px 1fr 56px; gap: 10px; align-items: center; font-size: 14px; }
.bar .track { height: 10px; background: #eef0f4; border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 99px; }
.bar .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.iq-big { font-size: 96px; font-weight: 900; letter-spacing: -.04em; line-height: 1; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.class-badge { display: inline-block; margin-top: 10px; padding: 6px 16px; border-radius: 999px; background: #fef3c7; color: #92400e; font-weight: 800; }
.result-section { margin-top: 20px; }
.result-section h2 { font-size: 20px; }
.cert-canvas { width: 100%; height: auto; border-radius: 10px; box-shadow: var(--shadow); display: block; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.review-item { border-top: 1px solid var(--line); padding: 20px 0; }
.review-item:first-of-type { border-top: 0; }
.review-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.review-grid { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; }
.review-grid .options { grid-template-columns: repeat(6, 1fr); gap: 6px; }
.review-grid .option { padding: 6%; border-radius: 8px; }
@media (max-width: 640px) {
  .review-grid { grid-template-columns: 1fr; }
  .review-grid .matrix { max-width: 220px; }
  .review-grid .options { grid-template-columns: repeat(3, 1fr); }
  .result-hero .rank { font-size: 40px; }
  .iq-big { font-size: 76px; }
}
.tag-ok { color: var(--good); font-weight: 800; }
.tag-no { color: var(--bad); font-weight: 800; }
.tag-skip { color: var(--muted); font-weight: 800; }

/* ------------------------------------------------ modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .55); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s ease; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 420px; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal h3 { margin-bottom: 4px; }
.mock-card { margin: 16px 0; border-radius: 14px; padding: 18px; color: #fff; background: linear-gradient(135deg, #1f2937, #4f46e5); font-family: ui-monospace, monospace; }
.mock-card .no { font-size: 18px; letter-spacing: .1em; margin-top: 18px; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 12px 0; }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 60; font-size: 14px; animation: fade .2s ease; }

/* ------------------------------------------------ ads */
.ad { margin: 24px auto; max-width: 728px; text-align: center; }
.ad-label { font-size: 11px; color: #9ca3af; margin-bottom: 4px; letter-spacing: .05em; }
.ad-placeholder { height: 100px; border: 2px dashed #d1d5db; border-radius: 12px; display: grid; place-items: center; color: #9ca3af; font-size: 13px; background: #fafafa; }
.result-section .ad { margin: 8px auto 20px; }
.policy h3 { margin-top: 20px; font-size: 17px; }
.policy p { color: #374151; font-size: 15px; }
