/* 사이트 공통 스타일. 토큰은 study.css 와 같은 계열이다. */
:root {
  --ground: #0f1216; --surface: #171b21; --surface-2: #1e242b; --surface-3: #262e37;
  --ink: #e8ecf1; --muted: #a2adb9; --faint: #78838f; --line: #262d35;
  --accent: #4fa3b1; --accent-ink: #06181c; --accent-soft: rgba(79, 163, 177, .14);
  --rec: #e4634a; --ok: #5fb47f; --amber: #d6a44f; --violet: #9d92e6;
  --ok-bg: rgba(95, 180, 127, .16); --warn-bg: rgba(214, 164, 79, .16); --bad-bg: rgba(228, 99, 74, .16);
  --shadow: 0 18px 50px -30px #000; --radius: 12px;
  --font: "Noto Sans KR", "Pretendard", "Malgun Gothic", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --ground: #f3f5f7; --surface: #ffffff; --surface-2: #eaeef2; --surface-3: #dde3e9;
    --ink: #12171e; --muted: #4c5763; --faint: #6b7784; --line: #d8dee5;
    --accent: #1f6a77; --accent-ink: #ffffff; --accent-soft: rgba(31, 106, 119, .1);
    --rec: #c4402b; --ok: #2c7a52; --amber: #8a6216; --violet: #5f52c2;
    --ok-bg: rgba(44, 122, 82, .12); --warn-bg: rgba(138, 98, 22, .13); --bad-bg: rgba(196, 64, 43, .12);
    --shadow: 0 12px 32px -22px rgba(18, 23, 30, .35);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--font); font-size: 16px;
  line-height: 1.7; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
p { margin: 0 0 .8em; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.fine { font-size: .84rem; color: var(--faint); }
.hint { font-size: .9rem; color: var(--muted); }

/* 내비게이션 */
#site-nav { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-in { max-width: 1080px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.nav-links { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav-links a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: .95rem; white-space: nowrap; }
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a.is-on { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-user { color: var(--muted); font-size: .9rem; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
@media (max-width: 720px) {
  .nav-in { flex-wrap: wrap; gap: 6px 12px; padding: 8px 14px; }
  .nav-links { order: 3; width: 100%; flex-basis: 100%; }
  .brand span:last-child { font-size: .95rem; }
}

/* 레이아웃 */
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 20px 60px; }
.narrow { max-width: 460px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .g2, .g3 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .35em; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 14px; }
.eyebrow { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 10px; }
footer.site { border-top: 1px solid var(--line); padding: 22px 20px; text-align: center; font-size: .85rem; color: var(--faint); }
footer.site a { color: var(--muted); margin: 0 8px; }

/* 버튼·폼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px;
  padding: 11px 20px; font-weight: 600; cursor: pointer; text-decoration: none; transition: filter .15s, background .15s; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: transparent; border-color: var(--rec); color: var(--rec); }
.btn-sm { padding: 6px 12px; font-size: .88rem; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .86rem; color: var(--muted); margin-bottom: 5px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field select, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; margin-bottom: 10px; color: var(--muted); }
.check input { margin-top: 5px; }
.msg { padding: 10px 14px; border-radius: 9px; font-size: .92rem; margin-bottom: 14px; }
.msg.bad { background: var(--bad-bg); color: var(--rec); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.warn { background: var(--warn-bg); color: var(--amber); }
.tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 11px; margin-bottom: 20px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }

/* 뱃지·미터 */
.pill { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--surface-3); color: var(--muted); letter-spacing: .04em; }
.pill.pro { background: var(--accent); color: var(--accent-ink); }
.meter { height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.meter.full i { background: var(--rec); }
.usage-row { display: flex; justify-content: space-between; font-size: .88rem; margin: 12px 0 5px; color: var(--muted); }

/* 광고 */
.ad-slot { margin: 24px 0; min-height: 90px; border: 1px dashed var(--line); border-radius: 10px; padding: 8px; position: relative; }
.ad-label { position: absolute; top: 4px; left: 10px; font-size: .68rem; color: var(--faint); }
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 620px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: 0 20px 60px -20px #000; font-size: .9rem; }
.consent p { margin-bottom: 10px; color: var(--muted); }

/* 토스트 */
#toast { position: fixed; top: 70px; right: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: 340px; }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 12px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: .92rem; }
.toast.bad { border-left-color: var(--rec); }

/* 랜딩 */
.hero { padding: 36px 0 30px; }
.hero p.lede { font-size: 1.12rem; color: var(--muted); max-width: 640px; }
.feature .n { font-family: var(--mono); color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.price { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.price small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.plan ul { padding-left: 1.2em; color: var(--muted); }
.plan.pro { border-color: var(--accent); }
