:root {
  --bg: #0b0f14;
  --panel: #121821;
  --panel-2: #182030;
  --border: #243044;
  --text: #e7eef8;
  --muted: #8b9bb0;
  --accent: #a78bfa;
  --accent-2: #22d3ee;
  --critical: #f87171;
  --high: #fb923c;
  --medium: #fbbf24;
  --low: #38bdf8;
  --info: #94a3b8;
  --ok: #4ade80;
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(167, 139, 250, 0.18), transparent),
    linear-gradient(rgba(36, 48, 68, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 48, 68, 0.35) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* ---- Nav ---- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 20, 0.75);
}
.nav-brand { display: flex; gap: 0.5rem; align-items: center; }
.nav-name { font-weight: 700; font-size: 1.1rem; }
.nav-links { display: flex; gap: 1.25rem; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.nav-links a:hover { color: var(--text); }
.logo { font-size: 1.4rem; }

/* ---- Hero ---- */
.hero {
  position: relative; z-index: 1;
  max-width: 820px; margin: 4rem auto 3rem; padding: 0 1.5rem; text-align: center;
}
.hero-badge {
  display: inline-block;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.3);
  color: var(--accent); border-radius: 999px;
  padding: 0.35rem 1rem; font-size: 0.8rem; margin-bottom: 1.5rem;
}
.hero h1 { font-size: 3rem; font-weight: 800; line-height: 1.15; margin: 0 0 1rem; letter-spacing: -0.03em; }
.hero-accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { color: var(--muted); font-size: 1.15rem; max-width: 560px; margin: 0 auto 2rem; line-height: 1.6; }
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.hero-score { margin-top: 2rem; display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.mini-score {
  font-size: 1.5rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.mini-score span { font-size: 0.8rem; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.mini-score-label { color: var(--muted); font-size: 0.85rem; }
.mini-score-label a { color: var(--accent); text-decoration: none; }

/* ---- Sections ---- */
.section {
  position: relative; z-index: 1;
  max-width: 960px; margin: 3rem auto; padding: 0 1.5rem;
}
.section-title { font-size: 1.75rem; font-weight: 700; margin: 0 0 2rem; letter-spacing: -0.02em; text-align: center; }
.section-title .muted { color: var(--muted); }

/* ---- Pain Grid ---- */
.pain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.pain-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem;
}
.pain-icon { font-size: 1.5rem; margin-bottom: 0.75rem; }
.pain-bad {
  background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 8px; padding: 0.5rem 0.75rem;
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--critical); margin-bottom: 0.35rem;
  overflow-x: auto; white-space: nowrap;
}
.pain-bad-label { color: var(--muted); font-size: 0.85rem; }

/* ---- Proof ---- */
.proof {
  text-align: center;
}
.proof blockquote {
  margin: 0; padding: 2rem;
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.06), rgba(34, 211, 238, 0.04));
  border: 1px solid rgba(167, 139, 250, 0.15); border-radius: var(--radius);
  font-size: 1.1rem; font-style: italic; color: #ddd6fe;
  line-height: 1.7;
}
.proof cite { display: block; margin-top: 0.75rem; font-size: 0.85rem; color: var(--muted); font-style: normal; }

/* ---- Feature Grid ---- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.feature-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem;
}
.feature-card h4 { margin: 0 0 0.5rem; font-size: 1rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.55; }

/* ---- Score Boxes ---- */
.score-boxes {
  display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center;
}
.score-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 0.75rem 1.25rem; font-size: 0.95rem;
}
.score-box strong { color: var(--accent); }

/* ---- Pricing ---- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.pricing-card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; text-align: center;
  position: relative;
}
.pricing-card.featured { border-color: var(--accent); box-shadow: 0 0 30px rgba(167, 139, 250, 0.12); }
.featured-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--bg); border-radius: 999px;
  padding: 0.2rem 0.85rem; font-size: 0.75rem; font-weight: 600;
}
.pricing-card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.price { font-size: 2rem; font-weight: 800; margin: 0.5rem 0; }
.price span { font-size: 1rem; color: var(--muted); font-weight: 400; }
.pricing-card p { color: var(--muted); font-size: 0.9rem; margin: 0.5rem 0 1.25rem; }

/* ---- Cards & Forms ---- */
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 1rem; }
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.75rem 0 0.35rem;
}
label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  color: var(--text);
  font-size: 0.9rem;
}
input[type="text"], input[type="file"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font: inherit;
}
input[type="text"]:focus {
  outline: 2px solid rgba(167, 139, 250, 0.45);
  border-color: var(--accent);
}

.btn {
  display: inline-block;
  margin-top: 1rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn.primary {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  border-color: transparent;
  font-weight: 600;
}
.btn.secondary { background: var(--panel-2); }
.btn.large { padding: 0.8rem 1.5rem; font-size: 1.05rem; }
.btn:hover { filter: brightness(1.08); }
.btn.disabled { opacity: 0.5; pointer-events: none; }

.muted { color: var(--muted); }
.hidden { display: none !important; }
.error { border-color: var(--critical); color: var(--critical); }

#status {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Report (existing) ---- */
.score-hero { display: flex; gap: 1.5rem; align-items: center; }
.score-ring {
  width: 120px; height: 120px; border-radius: 50%;
  border: 6px solid var(--score-color, var(--accent));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0; background: rgba(0,0,0,0.25);
}
.score-num { font-size: 2.2rem; font-weight: 700; line-height: 1; color: var(--score-color, var(--text)); }
.score-denom { color: var(--muted); font-size: 0.85rem; }
.score-meta h2 { margin: 0 0 0.35rem; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.actions .btn { margin-top: 0.75rem; }

.sev-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.sev {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700;
  border-radius: 6px; padding: 0.2rem 0.45rem; background: #1e293b;
}
.sev-critical { color: var(--critical); background: rgba(248,113,113,0.12); }
.sev-high { color: var(--high); background: rgba(251,146,60,0.12); }
.sev-medium { color: var(--medium); background: rgba(251,191,36,0.12); }
.sev-low { color: var(--low); background: rgba(56,189,248,0.12); }
.sev-info { color: var(--info); }

.sev-border-critical { border-left: 3px solid var(--critical); }
.sev-border-high { border-left: 3px solid var(--high); }
.sev-border-medium { border-left: 3px solid var(--medium); }
.sev-border-low { border-left: 3px solid var(--low); }
.sev-border-info { border-left: 3px solid var(--info); }

.finding-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.35rem; }
.finding-head h3 { margin: 0; font-size: 1.05rem; flex: 1 1 100%; }
.rule-id { font-family: var(--mono); font-size: 0.8rem; color: var(--accent-2); }
.loc { color: var(--muted); font-size: 0.9rem; }
.fix { color: #bbf7d0; }
.snippet {
  background: #0a0e13; border: 1px solid var(--border); border-radius: 10px;
  padding: 0.75rem 1rem; overflow-x: auto;
  font-family: var(--mono); font-size: 0.82rem; color: #cbd5e1;
}
.clean h3 { color: var(--ok); margin-top: 0; }

/* ---- Footer ---- */
footer {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem;
  max-width: 960px; margin: 3rem auto 0; padding: 2rem 1.5rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.85rem;
}
.footer-col { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-col strong { color: var(--text); }
.footer-col a { color: var(--muted); text-decoration: none; }
.footer-col a:hover { color: var(--text); }

/* Pulse highlight for scroll-to-scanner */
@keyframes pulse { 0%,100% { box-shadow:0 0 0 0 rgba(167,139,250,0); } 50% { box-shadow:0 0 0 14px rgba(167,139,250,0.25); } }
#scanner.pulse { animation: pulse 2s ease-out; border-radius:12px; }
