:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #1d1b18;
  --muted: #5f5a52;
  --border: #e4e0d8;
  --accent: #b4462b;
  --accent-soft: #f7e6e0;
  --good: #2f6f4f;
  --good-soft: #e3f1e9;
  --bad: #a2331f;
  --bad-soft: #fbe7e2;
  --mark: #ffe39a;
  --code-bg: #1f1d1a;
  --code-text: #f1ede4;
  --radius: 10px;
  --maxw: 1080px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161513;
    --surface: #1e1d1a;
    --surface-2: #262420;
    --text: #ece8df;
    --muted: #a79f92;
    --border: #36332d;
    --accent: #e8805f;
    --accent-soft: #3a241c;
    --good: #7fcaa2;
    --good-soft: #1c2d24;
    --bad: #f09a85;
    --bad-soft: #3a211b;
    --mark: #6b5415;
    --code-bg: #0f0e0d;
  }
}
:root[data-theme="dark"] {
  --bg: #161513;
  --surface: #1e1d1a;
  --surface-2: #262420;
  --text: #ece8df;
  --muted: #a79f92;
  --border: #36332d;
  --accent: #e8805f;
  --accent-soft: #3a241c;
  --good: #7fcaa2;
  --good-soft: #1c2d24;
  --bad: #f09a85;
  --bad-soft: #3a211b;
  --mark: #6b5415;
  --code-bg: #0f0e0d;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  overflow-x: hidden;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 16px; }
h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin: 56px 0 14px; }
h3 { font-size: 1.15rem; margin: 28px 0 8px; }
p { margin: 0 0 14px; }
code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
pre {
  background: var(--code-bg); color: var(--code-text);
  padding: 14px 16px; border-radius: var(--radius);
  overflow-x: auto; font: 14px/1.55 var(--mono); margin: 0 0 16px;
  position: relative;
}
pre code { background: none; padding: 0; color: inherit; }
.copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: #3a372f; color: #f1ede4; border: 0; border-radius: 6px;
  font: 12px var(--font); padding: 4px 9px; cursor: pointer;
}
.copy-btn:hover { background: #504b40; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }

/* header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { border-bottom: 2px solid var(--accent); }
@media (max-width: 720px) {
  .site-header { position: static; }
  .site-header .wrap { padding-top: 10px; padding-bottom: 10px; }
  .nav { gap: 2px 14px; font-size: 14px; }
}

/* hero */
.hero { padding: 64px 0 40px; }
.eyebrow { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; margin-bottom: 10px; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 680px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn {
  display: inline-block; padding: 11px 18px; border-radius: 8px; font-weight: 600;
  text-decoration: none; border: 1px solid var(--border); color: var(--text); background: var(--surface);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:hover { filter: brightness(1.05); }

/* layout pieces */
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0 24px; }
@media (max-width: 720px) { .compare { grid-template-columns: 1fr; } }
.compare .side { border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--border); font-family: var(--serif); font-size: 1.05rem; }
.compare .side p:last-child { margin-bottom: 0; }
.compare .before { background: var(--bad-soft); }
.compare .after { background: var(--good-soft); }
.tag { display: inline-block; font: 600 12px var(--font); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.before .tag { color: var(--bad); }
.after .tag { color: var(--good); }

.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td:first-child { color: var(--muted); white-space: nowrap; }

.note { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 14px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 20px 0; }
.note p:last-child { margin: 0; }

.pattern { border-top: 1px solid var(--border); padding: 22px 0 6px; }
.pattern h3 { margin-top: 0; }
.pattern .num { color: var(--accent); font-family: var(--mono); margin-right: 6px; }
.weak { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
.watch { color: var(--muted); font-size: 15px; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.toc a { font-size: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; text-decoration: none; color: var(--text); }

details { border-bottom: 1px solid var(--border); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; }
details p { margin: 10px 0 0; color: var(--muted); }

.breadcrumb { font-size: 14px; color: var(--muted); padding-top: 24px; }
.breadcrumb a { color: var(--muted); }

/* checker */
textarea {
  width: 100%; min-height: 220px; padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 16px/1.6 var(--serif); resize: vertical;
}
textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.checker-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 24px; }
button.btn { cursor: pointer; font: 600 15px var(--font); }
.result-text { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; font: 1.05rem/1.7 var(--serif); white-space: pre-wrap; word-wrap: break-word; }
.result-text mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; cursor: help; }
.score { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.score .stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; min-width: 140px; }
.score .stat b { display: block; font-size: 1.6rem; line-height: 1.2; }
.score .stat span { font-size: 13px; color: var(--muted); }
.findings { list-style: none; padding: 0; margin: 0 0 20px; }
.findings li { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.findings li b { margin-right: 6px; }
.findings .hits { color: var(--muted); font-size: 14px; }

/* footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 72px; padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.site-footer .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.site-footer a { color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }

.install-cmd { font-size: 16px; padding: 18px 76px 18px 20px; border: 2px solid var(--accent); white-space: pre-wrap; word-break: break-all; }
.install-cmd .copy-btn { top: 50%; transform: translateY(-50%); }
.install-cmd code::before { content: "$ "; color: #a79f92; }
.card pre { white-space: pre-wrap; word-break: break-word; padding-right: 64px; }
