:root {
  --bg: #0d1117;
  --panel: #161b22;
  --panel2: #1c2330;
  --border: #2d3645;
  --text: #e6edf3;
  --muted: #9aa7b5;
  --accent: #4f8ff7;
  --accent2: #f7a64f;
  --green: #3fb950;
  --red: #f85149;
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }

header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13,17,23,0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
header.site .wrap { display: flex; align-items: center; gap: 18px; height: 58px; }
header.site .brand { font-weight: 700; font-size: 1.05rem; }
header.site nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
header.site nav a { color: var(--muted); font-size: .95rem; }
header.site nav a:hover { color: var(--text); text-decoration: none; }

.hero { padding: 64px 0 36px; text-align: center; }
.hero h1 { font-size: 2.3rem; line-height: 1.2; margin: 0 0 12px; }
.hero p.lead { font-size: 1.12rem; color: var(--muted); max-width: 720px; margin: 0 auto 22px; }
.badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.badge { background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-size: .85rem; color: var(--muted); }
.badge b { color: var(--text); }

section { padding: 34px 0; border-top: 1px solid var(--border); }
section h2 { font-size: 1.5rem; margin: 0 0 6px; }
section .sub { color: var(--muted); margin: 0 0 22px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; }
.card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.metric { text-align: center; }
.metric .val { font-size: 2rem; font-weight: 700; color: var(--accent); }
.metric .lbl { color: var(--muted); font-size: .9rem; }

/* Demo */
.demo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .demo { grid-template-columns: 1fr; } }
.drop {
  border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 26px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--panel2); }
.drop img { max-width: 100%; max-height: 240px; border-radius: 10px; margin-top: 10px; }
.drop .hint { color: var(--muted); font-size: .92rem; }
.samples { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; justify-content: center; }
.samples img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border); cursor: pointer; opacity: .85; }
.samples img:hover { opacity: 1; border-color: var(--accent); }

.result { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; justify-content: center; }
.result .verdict { font-size: 1.6rem; font-weight: 700; margin: 0 0 16px; }
.result .verdict.pothole { color: var(--accent2); }
.result .verdict.normal { color: var(--green); }
.result .verdict.idle { color: var(--muted); font-weight: 500; font-size: 1.05rem; }
.bar { margin: 8px 0; }
.bar .row { display: flex; justify-content: space-between; font-size: .9rem; margin-bottom: 4px; }
.bar .track { height: 10px; background: var(--panel2); border-radius: 999px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.bar .fill.normal { background: var(--green); }
.bar .fill.pothole { background: var(--accent2); }
.note { color: var(--muted); font-size: .82rem; margin-top: 12px; }

footer { padding: 36px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }

/* Markdown viewer */
.md { padding: 30px 0 60px; }
.md h1 { font-size: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.md h2 { font-size: 1.5rem; margin-top: 1.8em; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.md h3 { font-size: 1.2rem; margin-top: 1.5em; }
.md table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: .92rem; }
.md th, .md td { border: 1px solid var(--border); padding: 7px 11px; text-align: left; }
.md th { background: var(--panel2); }
.md tr:nth-child(even) td { background: rgba(255,255,255,0.02); }
.md img { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); margin: 12px 0; }
.md code { background: var(--panel2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.md pre { background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--accent); margin: 14px 0; padding: 4px 16px;
  color: var(--muted); background: var(--panel); border-radius: 0 8px 8px 0; }
.md .mermaid { background: #fff; border-radius: 10px; padding: 16px; margin: 16px 0; text-align: center; }
.toc { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 24px; }
.toc a { display: inline-block; margin: 3px 10px 3px 0; color: var(--muted); font-size: .9rem; }
.spinner { color: var(--muted); padding: 40px 0; text-align: center; }
