:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #efede8;
  --text: #1c1b19;
  --muted: #6b6760;
  --line: #dedad2;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fbe6dc;
  --ok: #15803d;
  --err: #b91c1c;
  --radius: 14px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311;
    --surface: #1d1c19;
    --surface-2: #26241f;
    --text: #ece9e3;
    --muted: #a19c92;
    --line: #34312b;
    --accent: #f97316;
    --accent-ink: #1a0f08;
    --accent-soft: #3a2216;
    --ok: #4ade80;
    --err: #f87171;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141311; --surface: #1d1c19; --surface-2: #26241f; --text: #ece9e3; --muted: #a19c92;
  --line: #34312b; --accent: #f97316; --accent-ink: #1a0f08; --accent-soft: #3a2216; --ok: #4ade80; --err: #f87171;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
}
a { color: inherit; }
img { max-width: 100%; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* 머리글 */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -0.02em; font-size: 1.1rem; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--text); color: var(--bg); font-size: 1.05rem; font-weight: 900;
}
.site-nav { display: flex; gap: 18px; font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

/* 첫 화면 */
.hero { padding: 56px 0 28px; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.25; letter-spacing: -0.03em; margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: 1.05rem; margin: 0; max-width: 40em; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding: 12px 0 40px; }
.tool-card {
  display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; transition: border-color .15s, transform .15s;
}
a.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-card h2 { margin: 10px 0 6px; font-size: 1.15rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.tool-card .icon { font-size: 1.6rem; }
.tool-card.soon { opacity: .6; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: middle; }
.badge.gray { background: var(--surface-2); color: var(--muted); }

.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding-bottom: 40px; }
.point { border-top: 2px solid var(--text); padding-top: 12px; }
.point h3 { margin: 0 0 4px; font-size: 1rem; }
.point p { margin: 0; color: var(--muted); font-size: .93rem; }

/* 도구 화면 */
.tool-head { padding: 40px 0 16px; }
.tool-head h1 { margin: 0 0 8px; font-size: clamp(1.6rem, 4.5vw, 2.2rem); letter-spacing: -0.03em; }
.tool-head p { margin: 0; color: var(--muted); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }

.drop {
  display: block;
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 40px 16px; text-align: center; cursor: pointer;
  background: var(--surface-2); transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { display: block; font-size: 1.1rem; margin-bottom: 4px; }
.drop span { color: var(--muted); font-size: .92rem; }
.drop input { display: none; }

.options { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 16px 0 4px; font-size: .95rem; }
.options label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

.btn {
  appearance: none; border: 0; border-radius: 10px; padding: 12px 20px; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }

.file-name { font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 10px 0 6px; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.status-line { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; color: var(--muted); flex-wrap: wrap; }
.error { color: var(--err); font-weight: 600; }

.stem { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
.stem:first-child { border-top: 0; padding-top: 0; }
.stem-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.stem-top h3 { margin: 0; font-size: 1.02rem; }
.stem audio { width: 100%; }
.stem a.btn { text-decoration: none; padding: 9px 14px; font-size: .92rem; }

/* 광고 자리 */
.ad-slot { margin: 24px 0; min-height: 0; text-align: center; }
.ad-slot:empty { display: none; }
.ad-slot .ad-label { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 4px; letter-spacing: .05em; }

/* 본문 글 */
.article { padding-bottom: 32px; }
.article h2 { font-size: 1.3rem; margin: 36px 0 10px; letter-spacing: -0.02em; }
.article h3 { font-size: 1.05rem; margin: 22px 0 6px; }
.article p, .article li { color: var(--text); }
.article .lead { color: var(--muted); }
details.faq { border-top: 1px solid var(--line); padding: 12px 0; }
details.faq summary { cursor: pointer; font-weight: 700; }
details.faq p { margin: 8px 0 0; color: var(--muted); }

/* 바닥글 */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0 40px; color: var(--muted); font-size: .88rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
.site-footer a { color: var(--muted); }

@media (max-width: 560px) {
  .site-nav { gap: 12px; font-size: .9rem; }
  .hero { padding-top: 36px; }
  .panel { padding: 16px; }
}
