/* TestHeal — "retarget lock" theme. The product's drama is a selector
   losing its target and the model re-acquiring it on the semantically
   correct element, so a warm brass/gold is the one interactive accent (a
   "solder/weld" color — mending a broken connection), separate entirely
   from the red/amber/green confidence semantics used for the heal verdict
   itself. Dark technical console, matching the AppTechLab dev-tool base,
   but warm-toned rather than cool — this is a workbench, not a security
   console. */
:root {
  --bg: #120f0a;
  --surface: #1c160e;
  --surface-2: #241d12;
  --line: #3a2f1c;
  --line-soft: #291f13;
  --ink: #f5efe0;
  --muted: #a89676;
  --muted-dim: #776b50;

  --accent: #e3a640;       /* interactive accent — the "weld" gold */
  --accent-rgb: 227, 166, 64;

  --danger: #ff5d6c;       /* semantic: low confidence / needs human review */
  --danger-rgb: 255, 93, 108;
  --warn: #ff9f43;         /* semantic: medium confidence */
  --warn-rgb: 255, 159, 67;
  --safe: #3ddc97;         /* semantic: high confidence */
  --safe-rgb: 61, 220, 151;

  --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;
  word-break: break-word;
}

.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 — subtle, sits behind everything. */
#bg-fx {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none; opacity: 0.55;
}

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

/* ---- Header ---- */
header.site { position: sticky; top: 0; z-index: 20;
  background: rgba(18, 15, 10, 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: #1c1200; 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, #e9d9b8);
  -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; }

/* ---- Live console (the working demo, front and center) ---- */
.console {
  background: linear-gradient(180deg, var(--surface), #14100a);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 30px 70px -30px rgba(0,0,0,0.85), 0 0 0 1px rgba(var(--accent-rgb), 0.05);
  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: #4d4126; }
.console-bar .dot:nth-child(2) { background: #4d4126; }
.console-bar .dot:nth-child(3) { background: #4d4126; }
.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; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#before-input, #after-input {
  width: 100%; min-height: 96px; resize: vertical; font: 0.85rem/1.5 var(--font-mono);
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
#selector-input, #intent-input {
  width: 100%; font: inherit; font-size: 0.92rem;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}
.console-body label.mt { margin-top: 12px; }
#before-input::placeholder, #after-input::placeholder, #selector-input::placeholder, #intent-input::placeholder { color: var(--muted-dim); }
#before-input:focus-visible, #after-input:focus-visible, #selector-input:focus-visible, #intent-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: 6px 0 14px; }
.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); } }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600;
  padding: 6px 12px; border-radius: 8px;
}
.badge.clean { background: rgba(var(--safe-rgb), 0.12); color: var(--safe); border: 1px solid rgba(var(--safe-rgb), 0.35); }
.badge.flagged { background: rgba(var(--danger-rgb), 0.12); color: var(--danger); border: 1px solid rgba(var(--danger-rgb), 0.35); }
.badge.unknown { background: rgba(255,255,255,0.06); color: var(--muted); border: 1px solid var(--line); }

.match-row { margin-top: 12px; font-size: 0.92rem; }
.match-label { display: block; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted-dim); font-weight: 700; margin-bottom: 4px; }
.fallback-msg {
  margin: 12px 0 0; font-size: 0.95rem; color: var(--ink);
  background: rgba(var(--danger-rgb), 0.08); border: 1px solid rgba(var(--danger-rgb), 0.3);
  border-radius: 10px; padding: 12px 14px;
}
.reasoning { margin: 14px 0 0; font-size: 0.9rem; color: var(--muted); }
.reasoning .match-label { color: var(--muted-dim); }
.signals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag.sig {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; font-family: var(--font-mono);
  color: var(--accent); border: 1px solid rgba(var(--accent-rgb), 0.4); background: rgba(var(--accent-rgb), 0.1);
  border-radius: 999px; padding: 3px 9px;
}
.result .sub { color: var(--muted); font-size: 0.9rem; margin: 8px 0 0; }

/* ---- 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.accent { color: var(--accent); }
.tile-value.safe { color: var(--safe); }
.tile-value.warn { color: var(--danger); }
.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.signup, section.market { padding: 64px 0; }
.how h2, .feed h2, .signup h2 { font-size: 1.9rem; font-weight: 780; margin-top: 14px; text-wrap: balance; }
.how .sub, .feed .sub, .signup .sub { color: var(--muted); margin: 12px 0 0; max-width: 46em; }
.honesty-note { color: var(--muted); font-size: 0.92rem; margin: 28px 0 0; max-width: 56em; border-left: 3px solid var(--accent); padding-left: 14px; }

.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; }

/* ---- Market stat section ---- */
.market { background: var(--surface); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.stat-quote { font-size: 2rem; font-weight: 760; margin-top: 14px; max-width: 28em; text-wrap: balance; }
.market .sub { color: var(--muted); margin: 14px 0 0; max-width: 46em; }
.market .sub a { color: var(--accent); }

/* ---- Privacy note strip ---- */
.privacy-note { padding: 30px 0; }
.privacy-note p { color: var(--muted); font-size: 0.92rem; max-width: 62em; margin: 0; }
.privacy-note a { color: var(--accent); }

/* ---- 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.flagged { color: var(--danger); font-weight: 700; }
table.dashboard td.clean { color: var(--safe); font-weight: 700; }
table.dashboard td.accent-cell { color: var(--warn); font-weight: 700; }
table.dashboard td.error { color: var(--muted); font-weight: 700; }
.dashboard-empty { color: var(--muted); margin-top: 18px; font-size: 0.95rem; }

/* ---- Signup section ---- */
.signup .btn { margin-top: 24px; }

/* ---- 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(10, 8, 4, 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: 14px 0 6px; }
.modal label:first-of-type { margin-top: 0; }
.modal input[type=email], .modal select {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 10px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
}
.modal input[type=email]:focus-visible, .modal select: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(--safe); }
.status-msg.error { color: var(--danger); }

/* ---- Privacy page prose ---- */
main section .wrap h1 { font-size: 2rem; margin: 40px 0 20px; }
main section .wrap h2 { font-size: 1.25rem; margin: 30px 0 10px; }
main section .wrap p, main section .wrap ul { color: var(--muted); }
main section .wrap ul { padding-left: 22px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 2.2rem; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .field-pair { grid-template-columns: 1fr; }
  .nav-links a { display: none; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 1.9rem; }
  .stat-quote { font-size: 1.5rem; }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
  #bg-fx { display: none; }
}
