/* CarBluff design system — dark-first, inspection-report brutalism */
:root {
  --bg: #0b0e13;
  --panel: #12161d;
  --panel-2: #171c25;
  --border: #262d38;
  --ink: #edf1f5;
  --ink-2: #9aa5b1;
  --ink-3: #7b8695; /* WCAG AA: 4.9:1 on --panel, 5.2:1 on --bg for small text */
  --accent: #d7ff3e;
  --accent-ink: #0b0e13;
  --good: #4ade80;
  --warn: #fbbf24;
  --serious: #fb923c;
  --critical: #f87171;
  --radius: 2px;
  --bw: 2px;
  --font-head: "Chakra Petch", system-ui, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200; background: var(--accent);
  color: var(--accent-ink); padding: 12px 18px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
header {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  border-bottom: var(--bw) solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 8px 0; }
.logo svg { display: block; }
.logo b { font-size: 20px; letter-spacing: 0.06em; text-transform: uppercase; }
.logo b span { color: var(--accent); }
.nav a.link {
  color: var(--ink-2); text-decoration: none; font-family: var(--font-mono);
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; margin-left: 22px;
  display: inline-flex; align-items: center; min-height: 44px;
}
.nav a.link:hover, .nav a.link:focus-visible { color: var(--accent); }
@media (max-width: 640px) {
  /* two-row header: logo, then the nav strip — nothing hidden, nothing colliding */
  header { position: static; }
  .nav { height: auto; padding: 12px 20px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .nav nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
  .nav a.link { margin-left: 0; font-size: 12px; min-height: 40px; }
  .logo b { font-size: 18px; }
}

/* ---------- hero ---------- */
.hero { padding: 72px 0 0; border-bottom: var(--bw) solid var(--border); }
.hero-grid { display: grid; gap: 48px; grid-template-columns: 1fr; padding-bottom: 48px; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1.4fr 1fr; align-items: center; } }
.hero-card {
  border: var(--bw) solid var(--border); background: var(--panel);
  box-shadow: 10px 10px 0 rgba(215, 255, 62, 0.14);
  padding: 24px; border-radius: var(--radius); max-width: 380px; display: none;
}
@media (min-width: 1024px) { .hero-card { display: block; justify-self: end; } }
.hero-card-top {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--ink-3);
  border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 16px;
}
.hero-card-score {
  font-family: var(--font-mono); font-size: 64px; font-weight: 700; line-height: 1;
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.hero-card-score span { font-size: 22px; color: var(--ink-3); font-weight: 400; }
.hero-card-verdict {
  display: inline-block; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em;
  color: var(--critical); border: var(--bw) solid var(--critical); padding: 5px 10px; margin-top: 10px;
}
.hero-card-meter { position: relative; display: flex; height: 10px; border: var(--bw) solid var(--border); margin: 18px 0 16px; }
.hc-seg { height: 100%; }
.hc-1 { flex: 4; background: var(--critical); }
.hc-2 { flex: 2; background: var(--serious); opacity: 0.25; }
.hc-3 { flex: 2; background: var(--warn); opacity: 0.25; }
.hc-4 { flex: 2; background: var(--good); opacity: 0.25; }
.hc-pin { position: absolute; left: 23%; top: -7px; width: 2px; height: 24px; background: var(--ink); }
.hero-card-flag {
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-2);
  border-top: 1px solid var(--border); padding: 9px 0;
}
.hero-card-flag.dim { color: var(--ink-3); }
/* warning tape — the page's one authored motion moment */
.tape {
  border-top: var(--bw) solid var(--border); background: var(--accent);
  overflow: hidden; white-space: nowrap;
}
.tape-track { display: inline-block; animation: tape-scroll 28s linear infinite; }
.tape span {
  display: inline-block; font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  letter-spacing: 0.14em; color: var(--accent-ink); padding: 10px 0;
  padding-right: 0.9em; /* keeps the loop seam from colliding */
}
@keyframes tape-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.kicker {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 18px;
}
.kicker::before { content: "// "; color: var(--ink-3); }
h1 {
  font-size: clamp(38px, 7vw, 72px); line-height: 1.02; letter-spacing: -0.02em;
  text-transform: uppercase; font-weight: 700; max-width: 18ch;
}
h1 em { font-style: normal; color: var(--accent); }
.sub { color: var(--ink-2); max-width: 56ch; margin-top: 18px; font-size: 18px; }

/* ---------- analyzer ---------- */
.analyzer { padding: 48px 0; border-bottom: var(--bw) solid var(--border); }
.panel {
  background: var(--panel); border: var(--bw) solid var(--border); border-radius: var(--radius);
  padding: 28px;
}
.panel h2, section h2 {
  font-size: 24px; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 6px;
}
.panel .hint { color: var(--ink-3); font-size: 14px; margin-bottom: 22px; }
.grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } .grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; } }
.field label {
  display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px;
}
.field label .req { color: var(--accent); }
.field input, .field textarea {
  width: 100%; background: var(--bg); border: var(--bw) solid var(--border);
  border-radius: var(--radius); color: var(--ink); font-family: var(--font-mono);
  font-size: 15px; padding: 13px 14px; min-height: 48px;
  transition: border-color 150ms ease;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder, .restore-row input::placeholder {
  color: var(--ink-3); opacity: 1;
}
.field .help { color: var(--ink-3); font-size: 13px; margin-top: 6px; }
fieldset.obs { border: var(--bw) solid var(--border); border-radius: var(--radius); padding: 18px; }
fieldset.obs legend {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2); padding: 0 8px;
}
.check { display: flex; gap: 12px; align-items: center; padding: 11px 4px; cursor: pointer; min-height: 48px; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); cursor: pointer; flex: none; margin-top: 2px; }
.check span { font-size: 15px; color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px; border: var(--bw) solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font-family: var(--font-head);
  font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: 0.05em;
  border-radius: var(--radius); cursor: pointer; text-decoration: none;
  transition: background 120ms ease, color 120ms ease;
}
.btn:hover, .btn:focus-visible { background: var(--bg); color: var(--accent); }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn.ghost:hover, .btn.ghost:focus-visible { border-color: var(--accent); color: var(--accent); }
.actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.quota { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
.error-msg { color: var(--critical); font-family: var(--font-mono); font-size: 14px; margin-top: 12px; display: none; }

/* ---------- report ---------- */
#report { display: none; margin-top: 28px; }
.report-head {
  display: grid; gap: 28px; grid-template-columns: 1fr;
  border: var(--bw) solid var(--border); background: var(--panel-2); padding: 28px;
}
@media (min-width: 768px) { .report-head { grid-template-columns: auto 1fr; align-items: center; } }
.score-block { text-align: left; }
.score-num {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: clamp(72px, 12vw, 120px); font-weight: 700; line-height: 0.95; letter-spacing: -0.04em;
}
.score-den { font-size: 0.35em; color: var(--ink-3); font-weight: 400; }
.verdict {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 10px;
  font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase;
  border: var(--bw) solid currentColor; padding: 8px 14px; border-radius: var(--radius);
}
.verdict svg { flex: none; }
.b-low { color: var(--good); } .b-caution { color: var(--warn); }
.b-high { color: var(--serious); } .b-scam { color: var(--critical); }
.meter { margin-top: 6px; }
.meter-track {
  position: relative; height: 14px; border: var(--bw) solid var(--border);
  border-radius: var(--radius); display: flex; overflow: visible; background: var(--bg);
}
.meter-seg { height: 100%; opacity: 0.28; }
.meter-seg.on { opacity: 1; }
.seg-scam { width: 40%; background: var(--critical); }
.seg-high { width: 20%; background: var(--serious); }
.seg-caution { width: 20%; background: var(--warn); }
.seg-low { width: 20%; background: var(--good); }
.meter-pin {
  position: absolute; top: -12px; width: 2px; height: 34px; background: var(--ink);
  transform: translateX(-1px); transition: left 400ms ease-out;
}
.meter-labels {
  display: flex; justify-content: space-between; font-family: var(--font-mono);
  font-size: 11px; color: var(--ink-3); margin-top: 10px; letter-spacing: 0.08em;
}
.report-meta { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); margin-top: 16px; }
.flags { margin-top: 24px; display: grid; gap: 14px; }
.flag {
  border: var(--bw) solid var(--border); background: var(--panel);
  padding: 18px 20px; border-radius: var(--radius);
}
.flag h4 { font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flag .sev {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; border: 1px solid currentColor; border-radius: var(--radius);
}
.flag p { color: var(--ink-2); font-size: 15px; margin-top: 8px; }
.f-critical .sev { color: var(--critical); }
.f-major .sev { color: var(--serious); }
.f-moderate .sev { color: var(--warn); }
.f-minor .sev { color: var(--ink-2); }
.f-info .sev { color: var(--accent); }

/* ---------- article / guide pages ---------- */
.article-wrap { max-width: 760px; }
.article-wrap h1 { font-size: clamp(30px, 5.5vw, 48px); margin-bottom: 10px; }
.byline { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); margin-bottom: 22px; }
.article-wrap .lead { color: var(--ink-2); font-size: 17px; margin-bottom: 28px; }
.article-wrap h2 { font-size: 22px; text-transform: uppercase; margin: 36px 0 12px; }
.article-wrap p { color: var(--ink-2); font-size: 16px; margin-bottom: 14px; }
.article-wrap a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.cta-band {
  border: var(--bw) solid var(--accent); border-radius: var(--radius); background: var(--panel);
  padding: 20px; margin: 30px 0; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.cta-band p { flex: 1; min-width: 220px; margin: 0; color: var(--ink); }
.cta-band .btn { text-decoration: none; }
.steps-ol { margin: 0 0 14px 22px; color: var(--ink-2); display: grid; gap: 8px; font-size: 16px; }
.src-list { list-style: none; display: grid; gap: 8px; margin-bottom: 20px; }
.src-list li { color: var(--ink-2); font-size: 15px; }

/* ---------- unlimited toolkit ---------- */
.locked h3 { font-size: 20px; text-transform: uppercase; margin-bottom: 14px; }
.locked-list { list-style: none; display: grid; gap: 10px; margin-bottom: 8px; }
.locked-list li { color: var(--ink-2); font-size: 15px; }
.tk-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .tk-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.tk-title { font-size: 20px; text-transform: uppercase; margin-bottom: 6px; }
.tk-sub { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; margin: 22px 0 10px; }
.tpl { border: var(--bw) solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.tpl b { display: block; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.tpl p { color: var(--ink-2); font-size: 14px; margin-bottom: 10px; }
.tpl-copy { min-height: 40px; padding: 0 16px; font-size: 13px; }
.cklist { list-style: none; display: grid; gap: 8px; }
.cklist li { color: var(--ink-2); font-size: 14px; padding-left: 26px; position: relative; }
.cklist li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 14px; height: 14px;
  border: 2px solid var(--accent); border-radius: var(--radius);
}
.hist-item {
  display: flex; align-items: center; gap: 14px; border: var(--bw) solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; flex-wrap: wrap;
}
.hist-score { font-family: var(--font-mono); font-weight: 700; font-size: 20px; min-width: 3ch; }
.hist-meta { flex: 1; min-width: 160px; }
.hist-meta .hist-band { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; display: block; }
.hist-meta .hist-when { color: var(--ink-3); font-size: 12px; font-family: var(--font-mono); display: block; margin-top: 2px; overflow-wrap: anywhere; }
.hist-item .btn { min-height: 40px; padding: 0 14px; font-size: 13px; }
.hist-empty { color: var(--ink-3); font-family: var(--font-mono); font-size: 13px; padding: 8px 0 16px; }
@media print {
  body.print-kit * { visibility: hidden; }
  body.print-kit #kit-checklist, body.print-kit #kit-checklist * { visibility: visible; }
  body.print-kit #kit-checklist { position: absolute; top: 0; left: 0; }
  body.print-kit #kit-checklist, body.print-kit #kit-checklist li { color: #000; }
}

/* ---------- ads (hidden until an ad client is configured; never shown to subscribers) ---------- */
.ad-slot { display: none; }
.ad-slot.on {
  display: block; margin-top: 32px; border: var(--bw) solid var(--border);
  border-radius: var(--radius); padding: 14px; min-height: 110px; background: var(--panel);
}
.ad-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3);
}
.ad-slot .ad-tag { display: block; margin-bottom: 8px; }
.clean {
  border: var(--bw) solid var(--good); color: var(--good); padding: 18px 20px;
  font-family: var(--font-mono); font-size: 14px; border-radius: var(--radius);
}
.kit { margin-top: 28px; }
.kit h3 { text-transform: uppercase; font-size: 18px; margin-bottom: 12px; }
.kit ul { list-style: none; display: grid; gap: 10px; }
.kit li {
  border: var(--bw) solid var(--border); padding: 14px 16px; border-radius: var(--radius);
  font-size: 15px; color: var(--ink-2);
}
.kit a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.disclaimer { color: var(--ink-3); font-size: 13px; margin-top: 22px; font-family: var(--font-mono); }

/* ---------- info sections ---------- */
section.block { padding: 64px 0; border-bottom: var(--bw) solid var(--border); }
section.block .lead { color: var(--ink-2); max-width: 60ch; margin: 10px 0 34px; }
section.block .lead a, .panel .hint a, footer a {
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px;
}
section.block .lead a:hover, footer a:hover { color: var(--ink); }
.steps { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { border: var(--bw) solid var(--border); background: var(--panel); padding: 24px; border-radius: var(--radius); }
.step-count {
  font-family: var(--font-mono); color: var(--ink-3); font-size: 12px; letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 10px;
}
.step-count b { color: var(--accent); font-size: 22px; letter-spacing: -0.02em; margin-right: 4px; }
.step h3 { font-size: 18px; text-transform: uppercase; margin-bottom: 8px; }
.step p { color: var(--ink-2); font-size: 15px; }

/* ---------- pricing ---------- */
.plans { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan {
  border: var(--bw) solid var(--border); background: var(--panel); padding: 28px;
  border-radius: var(--radius); display: flex; flex-direction: column;
  transition: border-color 150ms ease;
}
.plan:hover { border-color: var(--ink-3); }
.plan.featured:hover { border-color: var(--accent); }
.plan.featured { border-color: var(--accent); position: relative; }
.plan.featured::after {
  content: "BEST VALUE"; position: absolute; top: -13px; right: 16px;
  background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.1em; padding: 3px 10px;
}
.plan h3 { font-size: 15px; font-family: var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }
.price { font-size: 44px; font-weight: 700; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.price small { font-size: 16px; color: var(--ink-3); font-weight: 400; }
.plan ul { list-style: none; margin: 18px 0 24px; flex: 1; }
.plan li { color: var(--ink-2); font-size: 15px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.plan .btn { width: 100%; }

/* ---------- FAQ / footer ---------- */
details { border: var(--bw) solid var(--border); border-radius: var(--radius); margin-bottom: 12px; background: var(--panel); }
details summary {
  cursor: pointer; padding: 18px 20px; font-weight: 700; font-size: 16px; list-style: none;
}
details summary::after { content: "+"; float: right; color: var(--accent); font-family: var(--font-mono); }
details[open] summary::after { content: "–"; }
#faq details div { padding: 0 20px 18px; color: var(--ink-2); font-size: 15px; }
.adv { margin-top: 18px; }
.adv .inner { padding: 18px; display: grid; gap: 18px; }
.fallback-note { color: var(--warn); font-size: 14px; margin-bottom: 14px; font-family: var(--font-mono); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
footer { padding: 40px 0 60px; color: var(--ink-3); font-family: var(--font-mono); font-size: 13px; }
footer a { color: var(--ink-2); display: inline-block; padding: 12px 0; }

/* ---------- paywall modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 6, 9, 0.72); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--panel); border: var(--bw) solid var(--accent); border-radius: var(--radius);
  max-width: 520px; width: 100%; padding: 32px; position: relative;
}
.modal h3 { font-size: 24px; text-transform: uppercase; margin-bottom: 8px; }
.modal p { color: var(--ink-2); margin-bottom: 20px; }
.modal .close {
  position: absolute; top: 10px; right: 10px; background: none; border: none;
  color: var(--ink-2); font-size: 26px; cursor: pointer; width: 44px; height: 44px;
}
.modal .close:hover { color: var(--accent); }
.modal .actions { margin-top: 0; }
.restore { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 18px; }
.restore-label { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 12px; }
.restore-row { display: flex; gap: 10px; flex-wrap: wrap; }
.restore-row input {
  flex: 1; min-width: 200px; background: var(--bg); border: var(--bw) solid var(--border);
  border-radius: var(--radius); color: var(--ink); font-family: var(--font-mono);
  font-size: 15px; padding: 12px 14px; min-height: 48px;
}
.restore-row input:focus { outline: none; border-color: var(--accent); }
.restore-msg { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); margin-top: 10px; min-height: 1.2em; }
.linklike {
  background: none; border: none; color: var(--ink-2); font-family: var(--font-mono);
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 8px; min-height: 44px;
}
.linklike:hover, .linklike:focus-visible { color: var(--accent); }
