:root {
  --bg: #f7f8fa;
  --fg: #16203a;
  --muted: #5b6472;
  --accent: #2563eb;
  --card: #ffffff;
  --border: #e5e7eb;
  --chip: #eef2ff;
  --maxw: 720px;
}
:root[data-theme="dark"] {
  --bg: #0f1420; --fg: #e5e9f0; --muted: #9aa4b2; --accent: #6b9bff;
  --card: #171d2b; --border: #2a3244; --chip: #1e2740;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1420; --fg: #e5e9f0; --muted: #9aa4b2; --accent: #6b9bff;
    --card: #171d2b; --border: #2a3244; --chip: #1e2740;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* Korean: break at word boundaries, not between syllables (avoids "이해하 고"). */
  word-break: keep-all;
  overflow-wrap: break-word;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 32px 20px 72px; }

.site-nav { display: flex; align-items: center; gap: 12px; padding: 18px 0; }
.brand { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.brand .dot { color: var(--accent); }
.site-nav a { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 14px; }
.site-nav a:hover { color: var(--accent); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-actions a { margin-left: 0; }
.language-picker select {
  min-height: 36px;
  max-width: 160px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 28px 6px 10px;
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
}
.language-picker select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero { padding: 40px 0 8px; }
.hero h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.02em; text-wrap: balance; word-break: keep-all; overflow-wrap: break-word; }
.hero p { font-size: 18px; color: var(--muted); margin: 0 0 28px; max-width: 60ch; }
.cta { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; padding: 12px 20px; border-radius: 12px; }
.cta.secondary { background: transparent; color: var(--accent); border: 1px solid var(--border); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 48px 0; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }

.note { background: var(--chip); border-radius: 12px; padding: 16px 18px; font-size: 14px; color: var(--fg); margin: 32px 0; }

.support-card {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  margin: 10px 0 0;
  padding: 5px 8px;
  border: 1px solid #f6b18b;
  border-radius: 9px;
  background: #fffaf7;
  color: #2b2521;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease;
}
.support-card:hover {
  transform: translateY(-2px);
  border-color: #ff5e20;
}
.support-card-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 6px;
  object-fit: contain;
}
.support-card-copy { min-width: 0; }
.support-card-copy strong { font-size: 14px; line-height: 1.25; }
html[lang="ko"] [data-kofi-support] { display: none; }

.doc h1 { font-size: 30px; letter-spacing: -0.01em; }
.doc h2 { font-size: 19px; margin-top: 34px; }
.doc p, .doc li { color: var(--fg); }
.doc ul { padding-left: 20px; }
.doc .updated { color: var(--muted); font-size: 14px; }
.doc code { background: var(--chip); color: var(--accent); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
/* Body links only — the nav and footer keep their own muted colour. */
.doc p a, .doc li a, .doc h3 a, .doc .note a { color: var(--accent); }

.footer { border-top: 1px solid var(--border); margin-top: 56px; padding-top: 24px; color: var(--muted); font-size: 13px; display: flex; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }

a:focus-visible, .cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.support-card:focus-visible { outline: 3px solid #ff5e20; outline-offset: 3px; }

@media (max-width: 520px) {
  .site-nav { align-items: flex-start; }
  .nav-actions { align-items: flex-end; flex-direction: column-reverse; gap: 6px; }
  .language-picker select { max-width: 128px; }
  .support-card { padding: 5px 7px; }
  .support-card-logo { width: 32px; height: 32px; flex-basis: 32px; }
}
