/* CertBridge — "radar scope" theme. The product's core act is scanning a
   device fleet and lighting up the ones about to fail, so the design is a
   dark ops console with a phosphor-green sweep as the one interactive
   accent, and red/amber/green reserved strictly as SEMANTIC risk-tier
   colors (not decoration) — same separation LLMFirewall uses for its
   block/pass verdicts. Single-theme dark on purpose: this reads as a NOC
   console, not a marketing page, and commits to one world. */
:root {
  --bg: #0a120d;
  --surface: #101a14;
  --surface-2: #16221a;
  --line: #233229;
  --line-soft: #1a251e;
  --ink: #e7f3ec;
  --muted: #87a294;
  --muted-dim: #5a7166;

  --accent: #39d98a;        /* interactive / radar sweep accent */
  --accent-rgb: 57, 217, 138;
  --critical: #ff5d6c;      /* semantic: critical risk tier */
  --critical-rgb: 255, 93, 108;
  --warning: #f5a623;       /* semantic: warning risk tier */
  --warning-rgb: 245, 166, 35;
  --ok: #39d98a;            /* semantic: ok / low risk tier (shares the accent hue on purpose — "healthy" reads as the same green as "go") */
  --ok-rgb: 57, 217, 138;

  --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --wrap: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; }
a { color: inherit; }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Animated background canvas — the radar sweep, subtle, sits behind everything. */
#bg-fx {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none; opacity: 0.55;
}

.pulse {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}

/* ---- Header ---- */
header.site { position: sticky; top: 0; z-index: 20;
  background: rgba(10, 18, 13, 0.72); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.logo { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.92rem; font-weight: 550; }
.nav-links a:hover { color: var(--ink); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: 0.95rem;
  background: var(--accent); color: #05170e; border: 1px solid var(--accent);
  padding: 12px 20px; border-radius: 10px; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -10px rgba(var(--accent-rgb), 0.6); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid rgba(var(--accent-rgb), 0.5); outline-offset: 2px; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--accent); box-shadow: none; }
.btn.btn-sm { padding: 8px 14px; font-size: 0.88rem; }
.btn.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

/* ---- Hero ---- */
.hero { padding: 60px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center;
  font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.1em;
  font-weight: 700; color: var(--muted);
}
.hero h1 {
  font-size: 2.85rem; font-weight: 820; margin-top: 16px; text-wrap: balance;
  background: linear-gradient(180deg, #ffffff, #bfe0cd);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .sub { color: var(--muted); font-size: 1.08rem; margin: 18px 0 0; max-width: 36em; }
.hero-copy .sub { line-height: 1.55; }

.detector-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 24px 0 0; }
.detector-chips li {
  font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.cta-row .link-btn { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 0.92rem; align-self: center; }
.cta-row .link-btn:hover { color: var(--accent); }

/* ---- Live console (the working demo, front and center) ---- */
.console {
  background: linear-gradient(180deg, var(--surface), #0c1610);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 30px 70px -30px rgba(0,0,0,0.8), 0 0 0 1px rgba(var(--accent-rgb), 0.04);
  overflow: hidden;
}
.console-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.02);
}
.console-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.console-bar .dot:nth-child(1) { background: #35493d; }
.console-bar .dot:nth-child(2) { background: #35493d; }
.console-bar .dot:nth-child(3) { background: #35493d; }
.console-title { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted-dim); margin-left: 6px; }
.console-live {
  margin-left: auto; font-size: 0.74rem; color: var(--muted);
  display: inline-flex; align-items: center; font-family: var(--font-mono);
}
.console-body { padding: 20px; }
.console-body label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
#inventory-input {
  width: 100%; min-height: 110px; resize: vertical; font: inherit; font-family: var(--font-mono); font-size: 0.88rem;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; line-height: 1.55;
}
#inventory-input::placeholder { color: var(--muted-dim); }
#inventory-input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18); }
.samples { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.chip-btn {
  font: inherit; font-size: 0.82rem; font-weight: 550; cursor: pointer;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px;
  transition: color .12s, border-color .12s;
}
.chip-btn:hover { color: var(--ink); border-color: var(--accent); }
.chip-btn:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.5); outline-offset: 2px; }

/* Result panel written by landing.js */
.result { display: none; margin-top: 16px; }
.result.show { display: block; animation: result-in .28s cubic-bezier(.2,.8,.3,1) both; }
@keyframes result-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.warning-banner {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.86rem; color: var(--warning);
  background: rgba(var(--warning-rgb), 0.1); border: 1px solid rgba(var(--warning-rgb), 0.35);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 14px;
}

.device-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.device-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--line);
  border-radius: 8px; padding: 10px 12px;
}
.device-row.tier-critical { border-left-color: var(--critical); }
.device-row.tier-warning { border-left-color: var(--warning); }
.device-row.tier-ok { border-left-color: var(--ok); }
.device-rank { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted-dim); }
.device-main .device-name { font-weight: 650; font-size: 0.94rem; }
.device-main .device-reason { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.device-main .device-quirk { color: var(--muted-dim); font-size: 0.78rem; margin-top: 3px; font-style: italic; }
.risk-badge {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}
.risk-badge.tier-critical { color: var(--critical); background: rgba(var(--critical-rgb), 0.12); border: 1px solid rgba(var(--critical-rgb), 0.35); }
.risk-badge.tier-warning { color: var(--warning); background: rgba(var(--warning-rgb), 0.12); border: 1px solid rgba(var(--warning-rgb), 0.35); }
.risk-badge.tier-ok { color: var(--ok); background: rgba(var(--ok-rgb), 0.12); border: 1px solid rgba(var(--ok-rgb), 0.35); }

.procedure-box { background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 14px; }
.procedure-box h4 { font-size: 0.95rem; margin: 0 0 6px; }
.procedure-box .summary { color: var(--muted); font-size: 0.88rem; margin: 0 0 10px; }
.procedure-box ol { margin: 0 0 12px; padding-left: 20px; color: var(--ink); font-size: 0.88rem; }
.procedure-box ol li { margin-bottom: 4px; }
.procedure-box pre {
  white-space: pre-wrap; font-family: var(--font-mono); font-size: 0.82rem; color: var(--ink);
  background: #08110c; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  max-height: 220px; overflow-y: auto; margin: 0;
}
.result .sub { color: var(--muted); font-size: 0.9rem; margin: 8px 0 0; }
.badge.error { display: inline-flex; font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600; color: var(--critical); background: rgba(var(--critical-rgb), 0.12); border: 1px solid rgba(var(--critical-rgb), 0.35); padding: 6px 12px; border-radius: 8px; margin-bottom: 10px; }

/* ---- Stat band ---- */
.stats-band { padding: 20px 0 8px; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px;
}
.tile-value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 2rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1;
}
.tile-value.danger { color: var(--critical); }
.tile-value.scan { color: var(--accent); }
.tile-value.safe { color: var(--ok); }
.tile-label { font-size: 0.86rem; font-weight: 600; margin-top: 10px; }
.tile-note { font-size: 0.76rem; color: var(--muted-dim); margin-top: 3px; }

/* ---- Sections ---- */
section.how, section.feed, section.market, section.signup { padding: 64px 0; }
.how h2, .feed h2, .market h2, .signup h2 { font-size: 1.9rem; font-weight: 780; margin-top: 14px; text-wrap: balance; }
.how .sub, .feed .sub, .market .sub, .signup .sub { color: var(--muted); margin: 12px 0 0; max-width: 46em; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 32px; }
.step-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px;
  position: relative; overflow: hidden;
}
.step-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.step-card .num { font-family: var(--font-mono); font-size: 0.85rem; color: var(--accent); font-weight: 700; }
.step-card h3 { font-size: 1.1rem; font-weight: 700; margin: 12px 0 8px; }
.step-card p { color: var(--muted); font-size: 0.95rem; margin: 0; }
.how-note { margin-top: 20px; color: var(--muted-dim); font-size: 0.88rem; border-left: 2px solid var(--line); padding-left: 12px; }

/* ---- Live feed table ---- */
.feed-table-wrap { margin-top: 28px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; overflow-x: auto; }
table.dashboard { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.dashboard th {
  text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted-dim); font-weight: 700; padding: 12px 18px; background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--line);
}
table.dashboard td { padding: 12px 18px; border-bottom: 1px solid var(--line-soft); font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--muted); }
table.dashboard tr:last-child td { border-bottom: none; }
table.dashboard tbody tr { transition: background .12s; }
table.dashboard tbody tr:hover { background: rgba(255,255,255,0.02); }
table.dashboard td.tier-critical { color: var(--critical); font-weight: 700; }
table.dashboard td.tier-warning { color: var(--warning); font-weight: 700; }
table.dashboard td.tier-ok { color: var(--ok); font-weight: 700; }
.dashboard-empty { color: var(--muted); margin-top: 18px; font-size: 0.95rem; }

/* ---- Market context ---- */
.market-card {
  margin-top: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 32px; display: flex; gap: 26px; align-items: center; flex-wrap: wrap;
}
.market-stat { font-family: var(--font-mono); font-size: 3rem; font-weight: 800; color: var(--accent); line-height: 1; }
.market-copy { flex: 1; min-width: 240px; }
.market-copy p { margin: 0; color: var(--ink); font-size: 0.98rem; }
.market-copy cite { display: block; margin-top: 8px; color: var(--muted-dim); font-size: 0.8rem; font-style: normal; }
.market-copy cite a { color: var(--muted); }
.market-copy cite a:hover { color: var(--accent); }

/* ---- Signup section ---- */
.signup .btn { margin-top: 24px; }
.signup-ctas { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* ---- Footer ---- */
footer.site { border-top: 1px solid var(--line-soft); padding: 28px 0 44px; margin-top: 24px; }
.footer-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 0.88rem; }
.footer-row a { color: var(--muted); text-decoration: none; }
.footer-row a:hover { color: var(--accent); }
.footer-row nav { display: flex; gap: 18px; }

/* ---- Signup modal ---- */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 40;
  background: rgba(4, 10, 7, 0.72); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; animation: fade-in .18s ease both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; width: 100%; max-width: 440px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px; box-shadow: 0 40px 90px -30px rgba(0,0,0,0.9);
}
.modal h3 { font-size: 1.35rem; font-weight: 780; }
.modal .sub { color: var(--muted); font-size: 0.95rem; margin: 10px 0 20px; }
.modal .close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.modal .close:hover { color: var(--ink); }
.modal label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; margin-top: 14px; }
.modal label:first-of-type { margin-top: 0; }
.modal input[type=email], .modal input[type=text] {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 10px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
}
.modal input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18); }
.consent-row { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; }
.consent-row input { margin-top: 4px; flex-shrink: 0; }
.consent-row label { font-size: 0.82rem; font-weight: 400; color: var(--muted); margin: 0; }
.consent-row a { color: var(--accent); }
.status-msg { font-size: 0.9rem; margin: 12px 0 0; }
.status-msg.success { color: var(--ok); }
.status-msg.error { color: var(--critical); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 2.25rem; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .nav-links a { display: none; }
  .device-row { grid-template-columns: auto 1fr; }
  .risk-badge { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 1.9rem; }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .market-card { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  #bg-fx { display: none; }
}
