/* ask.cmdspace.work — CMDSPACE v4.3 tokens (CMDS Color System v2.5) */
:root {
	--max: 760px;
	--text: #1a1a1a; --muted: #5f6662; --bg: #fbfcfb; --surface: #fff; --surface-2: #f3f6f4;
	--accent: #134538; --accent-light: #1a5c4a; --accent-on: #fff; --accent-tint: rgba(19, 69, 56, .08);
	--pink: #E985A2; --border: #e3e8e5; --danger: #a2283f;
	--radius: 16px;
	--font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Pretendard Variable', 'Pretendard', system-ui, sans-serif;
}
[data-theme="dark"] {
	--text: #f2f4f3; --muted: #9aa39d; --bg: #06080a; --surface: #0d1411; --surface-2: #121a16;
	--accent: #E985A2; --accent-light: #F4A4B8; --accent-on: #0b0f0d; --accent-tint: rgba(233, 133, 162, .12);
	--border: #1f2a25; --danger: #ff8fa6;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light dark; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.7; font-size: 16px; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
html[data-lang="ko"] .en, html[data-lang="en"] .ko { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* header */
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
	padding: 12px max(20px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 85%, transparent);
	backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
.brand { display: flex; gap: 8px; align-items: center; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .02em; font-size: 14px; }
.brand img { border-radius: 50%; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.pill, .icon-btn { font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.pill { padding: 5px 12px; font-weight: 600; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; }
[data-theme="dark"] .sun, [data-theme="light"] .moon { display: none; }

main { max-width: var(--max); margin: 0 auto; padding: 0 20px 64px; }

/* hero */
.hero { padding: 56px 0 28px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: lowercase; }
h1 { font-family: 'SF Pro Display', var(--font); font-size: clamp(34px, 7vw, 56px); line-height: 1.15; letter-spacing: -.02em; margin: 8px 0 16px; font-weight: 800; word-break: keep-all; }
.accent-word { color: var(--accent); }
.lead { font-size: 17px; color: var(--muted); max-width: 620px; word-break: keep-all; }

/* ask card */
.ask-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.mode-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; background: var(--surface-2); }
.mode-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.mode-opt input { margin-top: 5px; accent-color: var(--accent); }
.mode-opt b { display: block; font-size: 15px; }
.mode-opt small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
textarea, input:not([type]), input[type="text"] { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
textarea { resize: vertical; min-height: 110px; font-size: 16px; }
textarea:focus, input:focus { border-color: var(--accent); outline: none; }
.row-meta { text-align: right; font-size: 12px; color: var(--muted); margin: 4px 2px 8px; }
.who { margin: 4px 0 14px; font-size: 14px; }
.who summary { cursor: pointer; color: var(--muted); }
.who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.who-grid label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.consent { display: flex; gap: 8px; font-size: 13px; color: var(--muted); align-items: flex-start; }
.consent input { margin-top: 4px; accent-color: var(--accent); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.btn { font: inherit; font-weight: 600; border-radius: 999px; padding: 11px 22px; cursor: pointer; border: 1px solid transparent; }
.btn.primary { background: var(--accent); color: var(--accent-on); width: 100%; font-size: 16px; }
.btn.primary:hover { background: var(--accent-light); }
.btn.primary:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.link { background: none; color: var(--accent); padding: 8px 0; }
.privacy { font-size: 12.5px; color: var(--muted); margin-top: 12px; line-height: 1.6; word-break: keep-all; }
.error { color: var(--danger); font-size: 14px; margin-top: 10px; }

/* result */
.result { margin-top: 4px; }
.result-who { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
.result-answer { font-size: 17px; margin: 8px 0 12px; white-space: pre-wrap; word-break: keep-all; }
.routed { list-style: none; display: grid; gap: 8px; margin: 10px 0; }
.routed a { display: block; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); background: var(--surface-2); }
.routed a:hover { border-color: var(--accent); }
.routed .r-name { font-weight: 700; color: var(--accent); }
.routed .r-host { font-size: 12px; color: var(--muted); margin-left: 6px; }
.routed .r-sum { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.55; margin-top: 2px; }
.result-msg { font-size: 14px; color: var(--muted); margin: 10px 0; }
.feedback { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.follow { display: grid; gap: 8px; margin-top: 12px; font-size: 14px; }
.thanks { font-size: 14px; color: var(--accent); }

/* how */
.how { margin-top: 48px; }
.how h2 { font-size: 22px; margin-bottom: 14px; }
.steps { list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 52px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-on); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.steps b { display: block; }
.steps span { display: block; font-size: 14px; color: var(--muted); word-break: keep-all; }

.foot { border-top: 1px solid var(--border); padding: 28px 20px 40px; text-align: center; font-size: 14px; color: var(--muted); }
.foot-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.foot a { color: var(--text); text-decoration: none; }
.foot a:hover { color: var(--accent); }

@media (max-width: 560px) {
	.hero { padding-top: 36px; }
	.mode, .who-grid { grid-template-columns: 1fr; }
	.ask-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ================= Phase B: characters, directory, topics ================= */
:root { --max: 980px; --stage: #eef4f1; --stage-ring: #dfe9e4; }
[data-theme="dark"] { --stage: #e8eeeb; --stage-ring: #2a3a33; }
.nav-link { font-size: 13px; color: var(--muted); text-decoration: none; padding: 4px 6px; }
.nav-link:hover { color: var(--accent); }
.section-lead { color: var(--muted); font-size: 15px; margin: -6px 0 16px; word-break: keep-all; }
h2 { font-size: 24px; letter-spacing: -.01em; margin-bottom: 14px; }

/* character stage: pale disc so dark-green figures stay legible in dark mode */
.stage { background: var(--stage); border-radius: 50%; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 1px var(--stage-ring); overflow: hidden; }
.stage img { display: block; object-fit: contain; }
.stage-lg { width: 260px; height: 260px; } .stage-lg img { width: 240px; height: 240px; }
.stage-md { width: 132px; height: 132px; } .stage-md img { width: 122px; height: 122px; }
.stage-sm { width: 96px; height: 96px; } .stage-sm img { width: 88px; height: 88px; }
.stage-xs { width: 56px; height: 56px; } .stage-xs img { width: 50px; height: 50px; }
.stage-chip { width: 26px; height: 26px; } .stage-chip img { width: 26px; height: 26px; }

.hero { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.hero-art { position: relative; margin: 0; }
.bubble { position: absolute; top: -10px; right: 150px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 8px 12px; font-size: 13px; font-weight: 600; white-space: nowrap; z-index: 1; }
.bubble::after { content: ''; position: absolute; right: 18px; bottom: -7px; width: 12px; height: 12px; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: rotate(45deg); }
.ask-card { max-width: 760px; }

.thinking { display: flex; gap: 14px; align-items: center; padding: 12px 0; color: var(--muted); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.bob img { animation: bob 1.1s ease-in-out infinite; }
@keyframes slideIn { from { transform: translateX(-24px) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.slide-in img { animation: slideIn .45s cubic-bezier(.2, .8, .2, 1.2) both; }
.result-head { display: flex; gap: 16px; align-items: center; margin-bottom: 6px; }
.result-who { font-size: 16px; font-weight: 800; color: var(--text); }
.result-role { font-size: 13px; color: var(--accent); font-weight: 600; }
.cheer { display: flex; gap: 10px; align-items: center; }

/* topics */
.topics, .directory { margin-top: 56px; }
.topic-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.topic { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.topic summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; gap: 10px; align-items: center; font-weight: 700; }
.topic summary::-webkit-details-marker { display: none; }
.topic summary::after { content: '+'; margin-left: auto; color: var(--muted); font-weight: 400; }
.topic[open] summary::after { content: '–'; }
.topic-body { padding: 0 16px 14px; font-size: 14px; color: var(--muted); }
.topic-body ul { margin: 8px 0 10px 18px; }
.topic-body li { margin: 3px 0; }
.topic-body a { color: var(--accent); }
.try-q { font: inherit; font-size: 13px; background: var(--accent-tint); color: var(--accent); border: 0; border-radius: 999px; padding: 5px 12px; cursor: pointer; margin: 2px 4px 2px 0; text-align: left; }
.try-q:hover { background: var(--accent); color: var(--accent-on); }

/* directory */
.search input { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 11px 18px; }
.search input:focus { border-color: var(--accent); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 6px; }
.chip { font: inherit; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.chip.all { padding: 6px 14px; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-on); border-color: var(--accent); }
.dir-count { font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.svc { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none; }
.svc:hover { border-color: var(--accent); }
.svc-top { display: flex; gap: 8px; align-items: center; }
.svc-name { font-weight: 700; }
.svc-feat { font-size: 11px; font-weight: 700; color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: 0 7px; margin-left: auto; white-space: nowrap; }
.svc-sum { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.svc-host { font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 4px; }
.svc-kind { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.steps li { display: flex; gap: 14px; align-items: center; padding-left: 16px; }
.steps li::before { display: none; }
.foot-art { margin: 0 auto 10px; }

@media (max-width: 760px) {
	.hero { grid-template-columns: 1fr; gap: 8px; }
	.hero-art { justify-self: center; order: -1; margin-top: 18px; }
	.stage-lg { width: 140px; height: 140px; } .stage-lg img { width: 130px; height: 130px; }
	.bubble { right: auto; left: 50%; transform: translateX(-50%); top: -30px; font-size: 12px; }
	.bubble::after { right: calc(50% - 6px); }
	.nav-link { display: none; }
}
.dir-more { display: block; margin: 14px auto 0; }
