:root {
  --bg: #0b0b12;
  --bg2: #12121c;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #f3f2fa;
  --muted: #9b99ad;
  --accent: #a78bfa;
  --accent2: #f472b6;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 22px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; word-break: keep-all;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

/* 배경 셰이더 느낌의 블롭 (pen.dev 참고) */
.blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; animation: drift 18s ease-in-out infinite alternate; }
.blob.b1 { width: 520px; height: 520px; left: -160px; top: -120px; background: radial-gradient(circle, #7c3aed, transparent 65%); }
.blob.b2 { width: 480px; height: 480px; right: -140px; top: 20vh; background: radial-gradient(circle, #db2777, transparent 65%); animation-delay: -6s; }
.blob.b3 { width: 420px; height: 420px; left: 30vw; bottom: -180px; background: radial-gradient(circle, #0ea5e9, transparent 65%); animation-delay: -11s; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(60px, 40px) scale(1.15); } }

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

/* 헤더 */
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.logo .dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 0 18px var(--accent); }
.top nav a { color: var(--muted); text-decoration: none; margin-left: 18px; font-size: 14px; }
.top nav a:hover { color: var(--text); }

/* 히어로 */
.hero { padding: 64px 0 36px; text-align: center; }
.eyebrow { display: inline-block; font-size: 13px; color: var(--accent); background: rgba(167, 139, 250, .12); border: 1px solid rgba(167, 139, 250, .3); padding: 6px 14px; border-radius: 999px; margin-bottom: 20px; font-weight: 600; }
h1.title { font-size: clamp(40px, 8vw, 76px); line-height: 1.02; letter-spacing: -0.04em; margin: 0 0 18px; font-weight: 900; }
h1.title .grad { background: linear-gradient(90deg, #c4b5fd, #f9a8d4 60%, #fde68a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(16px, 2.4vw, 20px); color: var(--muted); max-width: 560px; margin: 0 auto 30px; }
.cta { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border: 0; padding: 16px 30px; border-radius: 999px; font-weight: 800; font-size: 17px; cursor: pointer; text-decoration: none; box-shadow: 0 10px 40px rgba(167, 139, 250, .35); transition: transform .15s; }
.cta:hover { transform: translateY(-2px); }
.hero-tags { margin-top: 26px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.hero-tags span { font-size: 13px; color: var(--muted); border: 1px solid var(--card-border); padding: 6px 12px; border-radius: 999px; background: var(--card); }

/* 섹션 공통 */
section { padding: 44px 0; }
h2.sec { font-size: clamp(24px, 4vw, 34px); letter-spacing: -0.03em; margin: 0 0 8px; font-weight: 800; }
p.sec-sub { color: var(--muted); margin: 0 0 26px; }
.card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(12px); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

/* 페인포인트 */
.pain { position: relative; }
.pain .q { font-size: 15px; color: #d9d7ea; margin: 0 0 12px; padding-left: 14px; border-left: 3px solid var(--accent2); font-style: normal; }
.pain .src { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.pain .a { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--text); margin-top: 8px; }
.pain .a b { color: var(--good); flex-shrink: 0; }

/* 폼 */
.tabs { display: flex; gap: 8px; background: var(--card); border: 1px solid var(--card-border); padding: 6px; border-radius: 999px; width: max-content; margin: 0 auto 24px; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 10px 20px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 15px; transition: .15s; }
.tab.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.person h3 { margin: 0 0 14px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.person h3 .badge { font-size: 12px; background: rgba(255,255,255,.08); padding: 3px 10px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.field input, .field select { width: 100%; background: rgba(0,0,0,.35); border: 1px solid var(--card-border); border-radius: 12px; padding: 12px 14px; color: var(--text); outline: none; transition: border .15s; -webkit-appearance: none; appearance: none; }
.field input:focus, .field select:focus { border-color: var(--accent); }
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; padding: 0; margin: 0; -webkit-appearance: checkbox; appearance: auto; accent-color: var(--accent); }
.mbti-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mbti-grid button { border: 1px solid var(--card-border); background: rgba(0,0,0,.3); border-radius: 10px; padding: 9px 4px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--muted); transition: .12s; }
.mbti-grid button:hover { color: var(--text); border-color: rgba(255,255,255,.3); }
.mbti-grid button.on { background: linear-gradient(135deg, rgba(167,139,250,.35), rgba(244,114,182,.35)); color: #fff; border-color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-actions { text-align: center; margin-top: 22px; }
.err { color: var(--bad); font-size: 14px; margin-top: 12px; text-align: center; min-height: 20px; }

/* 결과 */
#result { display: none; }
#result.show { display: block; }
.result-hero { text-align: center; padding: 30px 22px; position: relative; overflow: hidden; }
.result-hero .names { font-size: 15px; color: var(--muted); margin-bottom: 4px; }
.result-hero .names b { color: var(--text); }
.gauge { width: 240px; max-width: 80%; margin: 4px auto 0; display: block; }
.gauge-num { font-size: 44px; font-weight: 900; letter-spacing: -0.04em; }
.gauge-sub { font-size: 12px; fill: var(--muted); }
.grade { font-size: clamp(26px, 5vw, 36px); font-weight: 900; letter-spacing: -0.03em; margin: 2px 0 6px; }
.phase { display: inline-flex; flex-direction: column; gap: 2px; align-items: center; font-size: 14px; padding: 10px 18px; border-radius: 18px; background: rgba(255,255,255,.07); border: 1px solid var(--card-border); margin: 8px 0 14px; max-width: 520px; }
.phase .pd { color: #d9d7ea; font-size: 13px; }
.phase .k { font-weight: 800; }
.conf { font-size: 12px; color: var(--muted); }

.remain { background: linear-gradient(135deg, rgba(167,139,250,.18), rgba(244,114,182,.14)); border: 1px solid rgba(196,181,253,.35); }
.remain .lab { font-size: 14px; color: #ddd6fe; font-weight: 700; }
.remain .big { font-size: clamp(40px, 8vw, 64px); font-weight: 900; letter-spacing: -0.04em; line-height: 1.05; margin: 6px 0; }
.remain .big small { font-size: .45em; color: var(--muted); font-weight: 700; margin-left: 4px; }
.remain .why { color: #e9e7f5; font-size: 14px; }
.remain .why b { color: #fde68a; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.kv div { background: rgba(0,0,0,.25); border-radius: 14px; padding: 12px; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-weight: 800; font-size: 15px; margin-top: 2px; }

.subs { display: grid; gap: 10px; }
.sub { display: grid; grid-template-columns: 90px 1fr 48px; align-items: center; gap: 10px; font-size: 14px; }
.sub .k { font-weight: 700; }
.sub .k small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
.sub .track { height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.sub .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .8s ease; }
.sub .v { text-align: right; font-weight: 800; }

.radar { width: 100%; max-width: 320px; margin: 0 auto; display: block; }
.radar-label { font-size: 12px; fill: var(--muted); font-weight: 600; }
.radar-val { fill: #fff; font-weight: 800; }

.tl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tl { min-width: 640px; width: 100%; height: auto; }
.tl-label { font-size: 12px; fill: var(--muted); font-weight: 700; }
.tl-label.cur { fill: #fff; }
.tl-sub { font-size: 10px; fill: rgba(255,255,255,.35); }
.tl-score { font-size: 11px; font-weight: 800; }
.tl-band { font-size: 10px; fill: rgba(255,255,255,.35); }
.tl-pt { cursor: pointer; }
.tl-pt:focus { outline: none; }
.tl-pt:hover circle, .tl-pt:focus circle { r: 7; }
.tl-detail { margin-top: 12px; background: rgba(0,0,0,.28); border-radius: 14px; padding: 12px 14px; font-size: 14px; min-height: 48px; }
.tl-detail .d-title { font-weight: 800; }
.tl-detail ul { margin: 6px 0 0; padding-left: 18px; color: #d9d7ea; }
.seg { display: inline-flex; gap: 4px; background: rgba(0,0,0,.3); padding: 4px; border-radius: 999px; margin-bottom: 12px; }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 14px; border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 13px; }
.seg button.on { background: rgba(255,255,255,.12); color: #fff; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

.notes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.25); font-size: 14px; align-items: flex-start; }
.note .tag { flex-shrink: 0; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; margin-top: 1px; white-space: nowrap; }
.note.good .tag { background: rgba(52,211,153,.18); color: var(--good); }
.note.bad .tag { background: rgba(248,113,113,.18); color: var(--bad); }
.note.warn .tag { background: rgba(251,191,36,.18); color: var(--warn); }
.note.info .tag { background: rgba(255,255,255,.1); color: var(--muted); }

.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin: 10px 0 12px; }
.pillars div { background: rgba(0,0,0,.3); border-radius: 12px; padding: 10px 4px; }
.pillars .k { font-size: 11px; color: var(--muted); }
.pillars .v { font-size: 18px; font-weight: 900; letter-spacing: .04em; }
.dm { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.dm .el { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; font-weight: 900; flex-shrink: 0; }
.dm .t { font-size: 14px; }
.dm .t b { font-size: 16px; }
.dm .t span { color: var(--muted); display: block; font-size: 13px; }
.eld { width: 100%; max-width: 360px; display: block; margin: 0 auto 6px; }
.eld-el { font-size: 26px; font-weight: 900; fill: #fff; }
.eld-name { font-size: 13px; fill: var(--muted); font-weight: 700; }
.eld-rel { font-size: 13px; font-weight: 800; }
.elbars { display: grid; gap: 6px; margin-top: 8px; }
.elbar { display: grid; grid-template-columns: 22px 1fr 18px; align-items: center; gap: 8px; font-size: 12px; }
.elbar-k { font-weight: 800; }
.elbar-track { height: 8px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.elbar-fill { height: 100%; border-radius: 999px; }
.elbar-v { text-align: right; color: var(--muted); }

.axis { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--card-border); font-size: 14px; }
.axis:first-child { border-top: 0; }
.axis .pair { font-weight: 900; font-size: 18px; letter-spacing: .02em; }
.axis .pair small { display: block; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.axis.same .pair { color: var(--good); }
.axis.diff .pair { color: var(--warn); }

.share { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btn { border: 1px solid var(--card-border); background: rgba(255,255,255,.06); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; cursor: pointer; font-size: 14px; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; }
.btn:hover { filter: brightness(1.1); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: #fff; color: #111; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; opacity: 0; transition: .25s; pointer-events: none; z-index: 9; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

.recent { display: grid; gap: 8px; }
.recent a { display: flex; justify-content: space-between; align-items: center; text-decoration: none; background: rgba(0,0,0,.25); padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.recent a span { color: var(--muted); font-size: 12px; }

footer { padding: 40px 0 60px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.7; }
footer .disc { max-width: 640px; margin: 0 auto 10px; }

.fade { animation: fade .5s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .sub { grid-template-columns: 72px 1fr 40px; }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 10px 6px; font-size: 14px; }
  .kv { grid-template-columns: 1fr; }
}

/* 성별 라디오 */
.radios { display: flex; gap: 8px; }
.radios label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; background: rgba(0,0,0,.35); border: 1px solid var(--card-border); border-radius: 12px; padding: 10px; cursor: pointer; font-size: 14px; color: var(--muted); }
.radios label:has(input:checked) { border-color: var(--accent); color: #fff; background: rgba(167,139,250,.15); }
.radios input { -webkit-appearance: radio; appearance: auto; accent-color: var(--accent); margin: 0; }
.met .badge { font-size: 11px; background: rgba(255,255,255,.08); padding: 2px 8px; border-radius: 999px; color: var(--muted); font-weight: 600; vertical-align: middle; }

/* 인연 풀이 */
.reading { background: linear-gradient(180deg, rgba(167,139,250,.10), rgba(255,255,255,.03) 30%); border-color: rgba(196,181,253,.28); position: relative; overflow: hidden; }
.reading::before { content: ''; position: absolute; inset: -40% -20% auto; height: 60%; background: radial-gradient(ellipse at top, rgba(244,114,182,.18), transparent 60%); pointer-events: none; }
.reading-head { text-align: center; padding: 8px 0 18px; border-bottom: 1px dashed rgba(255,255,255,.14); margin-bottom: 8px; position: relative; }
.reading-head .seal { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid rgba(244,114,182,.7); color: #f9a8d4; font-size: 26px; font-weight: 900; margin-bottom: 10px; box-shadow: 0 0 24px rgba(244,114,182,.25), inset 0 0 12px rgba(244,114,182,.15); }
.reading-head h3 { margin: 0 0 6px; font-size: clamp(20px, 3.4vw, 26px); letter-spacing: -0.02em; }
.reading-head p { margin: 0; color: var(--muted); font-size: 14px; }
.chap { padding: 18px 0 10px; border-bottom: 1px solid rgba(255,255,255,.07); position: relative; }
.chap:last-of-type { border-bottom: 0; }
.chap-num { font-size: 12px; letter-spacing: .3em; color: #c4b5fd; font-weight: 700; }
.chap h4 { margin: 4px 0 10px; font-size: 18px; letter-spacing: -0.02em; }
.chap p { margin: 0 0 10px; font-size: 15px; line-height: 1.75; color: #e9e7f5; }
.chap p b { color: #fde68a; font-weight: 800; }
.db { width: 100%; min-width: 640px; height: auto; margin-top: 6px; }
.db-label { font-size: 10.5px; fill: #fff; font-weight: 700; }
.db-title { font-size: 12px; color: var(--muted); margin-top: 10px; font-weight: 700; }
details.evidence summary { cursor: pointer; font-weight: 800; font-size: 15px; list-style: none; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
details.evidence summary::before { content: '▸'; color: var(--accent); }
details.evidence[open] summary::before { content: '▾'; }
.ev-h { margin: 18px 0 8px; font-size: 15px; }

/* 점수 칩 + 레시피 */
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 4px 0 10px; }
.chip { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,.28); border: 1px solid var(--card-border); border-radius: 16px; padding: 10px 18px; min-width: 130px; }
.chip .k { font-size: 12px; color: var(--muted); font-weight: 700; }
.chip b { font-size: 28px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; }
.chip .s { font-size: 10.5px; color: rgba(255,255,255,.4); }
.recipe { font-size: 13px; color: #d9d7ea; max-width: 560px; margin: 0 auto 8px; line-height: 1.5; }
.recipe b { color: #fde68a; }
.recipe span { color: var(--muted); font-size: 12px; }

/* 오늘의 소통 */
.daily { background: linear-gradient(135deg, rgba(251,191,36,.10), rgba(255,255,255,.03) 60%); border-color: rgba(251,191,36,.3); }
.daily-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.daily-head .sun { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: radial-gradient(circle, rgba(253,224,71,.5), rgba(251,191,36,.08)); box-shadow: 0 0 22px rgba(251,191,36,.35); flex-shrink: 0; }
.daily-head h3 { margin: 0; font-size: 18px; }
.daily-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.daily p { font-size: 15px; line-height: 1.7; color: #e9e7f5; margin: 0 0 10px; }
.daily p b { color: #fde68a; }
.daily-flags { display: grid; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.daily-flags b { color: #fff; }
.fl { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.08); margin-left: 6px; color: #d9d7ea; }
.fl.bad { background: rgba(248,113,113,.18); color: var(--bad); }
.fl.good { background: rgba(52,211,153,.18); color: var(--good); }

.tl-now { font-size: 10px; fill: rgba(255,255,255,.55); font-weight: 700; }
.tl-met { font-size: 11px; fill: #f9a8d4; font-weight: 800; }
.tl-pt.past circle { opacity: .55; }
.tl-pt.past .tl-score { opacity: .6; }
