/* FPV DB — dark instrument-panel theme (Betaflight/OSD heritage) */
:root {
  --bg: #0d1117;
  --panel: #151c26;
  --panel-2: #1a2330;
  --fg: #d9e1ea;
  --muted: #8b96a5;
  --border: #243044;
  --accent: #f5b942;
  --accent-dim: rgba(245, 185, 66, .10);
  --link: #6fb8ff;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: "Space Grotesk", -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  background-image: radial-gradient(circle, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 26px 26px;
}
main { max-width: 1120px; margin: 0 auto; padding: 1rem 1.5rem 4rem; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 {
  font-family: var(--display);
  letter-spacing: -.01em;
  line-height: 1.2;
}
h1 { font-size: 1.9rem; margin: 1.2rem 0 .5rem; font-weight: 700; }
h2 { font-size: 1.3rem; margin-top: 2.2rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
.lead { color: var(--muted); font-size: 1.06rem; max-width: 60ch; }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: .8rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 17, 23, .92);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 10;
}
.logo {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  color: var(--fg) !important; letter-spacing: .01em;
}
.logo:hover { text-decoration: none; }
.logo svg { display: block; }
.logo b { color: var(--accent); font-weight: 700; }
.site-header nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.site-header nav a {
  color: var(--muted); font-size: .95rem; font-weight: 500;
  padding: .15rem 0; border-bottom: 2px solid transparent;
}
.site-header nav a:hover { color: var(--fg); text-decoration: none; border-bottom-color: var(--accent); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 3rem;
  padding: 1.4rem 1.25rem 2rem; color: var(--muted); font-size: .85rem;
}
.site-footer p { max-width: 900px; margin: .3rem auto; }

.breadcrumbs {
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  margin-top: 1.1rem; letter-spacing: .02em;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--link); }

/* ---------- hero / stats ---------- */
.hero { padding: 1.5rem 0 .5rem; }
.hero h1 { font-size: 2.4rem; margin-bottom: .4rem; }
.hero h1 em { font-style: normal; color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 1.6rem 0; }
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.1rem .9rem; color: var(--fg) !important; position: relative;
  transition: border-color .15s;
}
.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat strong {
  display: block; font-family: var(--mono); font-size: 1.9rem; font-weight: 600;
  color: var(--accent); line-height: 1.1; margin-bottom: .15rem;
}
.stat::after {
  content: "→"; position: absolute; right: .9rem; top: .9rem;
  color: var(--muted); font-size: .9rem;
}

/* ---------- tables ---------- */
table.specs, table.listing { border-collapse: collapse; width: 100%; margin: 1.1rem 0; }
table.specs th, table.specs td, table.listing th, table.listing td {
  text-align: left; padding: .5rem .65rem; border-bottom: 1px solid var(--border);
}
table.listing thead th, table.specs th {
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
table.specs th { width: 42%; }
table.specs td { font-family: var(--mono); font-size: .93rem; }
table.listing tbody tr:hover { background: var(--panel); }
table.listing td { font-size: .95rem; }

/* ---------- filters ---------- */
.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.2rem 0; }
.filters input, .filters select {
  padding: .5rem .7rem; font: inherit; font-size: .95rem;
  color: var(--fg); background: var(--panel);
  border: 1px solid var(--border); border-radius: 8px;
}
.filters input:focus, .filters select:focus {
  outline: none; border-color: var(--accent);
}
.hub-links { color: var(--muted); font-family: var(--mono); font-size: .85rem; line-height: 2; }

/* ---------- calculators ---------- */
.calc {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 1.1rem 1.2rem; margin: 1.1rem 0; max-width: 500px;
}
.calc label {
  display: block; font-family: var(--mono); font-size: .74rem;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: .75rem 0 .25rem;
}
.calc input {
  width: 100%; padding: .5rem .65rem; font: inherit;
  color: var(--fg); background: var(--bg);
  border: 1px solid var(--border); border-radius: 7px;
}
.calc input:focus { outline: none; border-color: var(--accent); }
.calc .result {
  margin-top: 1.1rem; font-family: var(--mono); font-size: 1.05rem;
  font-weight: 600; color: var(--accent); min-height: 1.4em;
}
.calc .note { font-size: .8rem; color: var(--muted); margin: .6rem 0 0; }

/* ---------- misc blocks ---------- */
img.product {
  max-width: 380px; width: 100%; height: auto; display: block;
  border: 1px solid var(--border); border-radius: 10px;
  margin: .8rem 0 1.2rem; background: #fff; padding: 10px;
}
p.insight {
  background: var(--accent-dim); border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0; padding: .7rem 1rem;
  font-size: .95rem; max-width: 64ch;
}
.related ul, section ul { padding-left: 1.3rem; }
li { margin: .2rem 0; }

.guide { max-width: 68ch; }
.guide table { border-collapse: collapse; margin: 1rem 0; width: 100%; }
.guide th, .guide td { border-bottom: 1px solid var(--border); padding: .45rem .6rem; text-align: left; }
.guide th { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.guide blockquote {
  border-left: 3px solid var(--accent); margin: 1rem 0; padding: .3rem 1rem;
  background: var(--panel); border-radius: 0 8px 8px 0; color: var(--muted);
}
.guide code { font-family: var(--mono); background: var(--panel); padding: .1em .35em; border-radius: 4px; font-size: .9em; }

/* wide tables scroll horizontally on narrow screens instead of clipping */
@media (max-width: 720px) {
  table.listing, table.specs { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.8rem; }
}

/* ---------- wide screens: product-style detail layout ---------- */
.detail-head {
  display: grid; grid-template-columns: 400px minmax(0, 1fr);
  gap: 2.4rem; align-items: start; margin-top: .4rem;
}
.detail-head img.product { max-width: 100%; margin: .4rem 0 0; position: sticky; top: 72px; }
.detail-head table.specs { margin-top: .4rem; }
.detail-head:not(:has(img.product)) { display: block; }
@media (max-width: 900px) { .detail-head { display: block; } }
@media (min-width: 1000px) {
  .hero { padding: 2.2rem 0 .8rem; }
  .hero h1 { font-size: 3rem; }
}
