:root {
  --bg: #0a0e1a;
  --bg-alt: #0f1520;
  --bg-card: #131a28;
  --fg: #e8edf5;
  --fg-secondary: #7a8aa3;
  --fg-muted: #4a5a70;
  --accent: #00e5c8;
  --accent-dim: rgba(0, 229, 200, 0.12);
  --alarm: #f59e0b;
  --alarm-dim: rgba(245, 158, 11, 0.12);
  --high: #ef4444;
  --med: #f59e0b;
  --low: #22c55e;
  --border: rgba(255, 255, 255, 0.07);
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --font-sans: 'IBM Plex Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.nav-tag {
  font-size: 0.75rem;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ── HERO ── */
.hero {
  padding: 5rem 2rem 4rem;
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  opacity: 0.8;
}
.hero-headline {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 4vw, 3.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 1.5rem;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--fg-secondary);
  line-height: 1.7;
  margin-bottom: 0.75rem;
  max-width: 480px;
}
.hero-sub-secondary {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  font-style: italic;
}

/* ── AUDIT CARD ── */
.audit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 229, 200, 0.06);
}
.audit-card-header {
  padding: 0.85rem 1.2rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.audit-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
}
.audit-score {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}
.audit-score.alarm { color: var(--alarm); }
.audit-finding { padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.audit-finding:last-of-type { border-bottom: none; }
.finding-row { display: flex; gap: 0.75rem; align-items: flex-start; }
.finding-severity {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.45rem;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.finding-severity.high { background: rgba(239,68,68,0.15); color: #ef4444; }
.finding-severity.med { background: rgba(245,158,11,0.15); color: #f59e0b; }
.finding-text { font-size: 0.82rem; color: var(--fg-secondary); line-height: 1.55; }
.mono { font-family: var(--font-mono); font-size: 0.78em; color: var(--accent); }
.audit-footer {
  padding: 0.65rem 1.2rem;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--fg-muted);
}

/* ── PROOF ── */
.proof {
  padding: 3rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.proof-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 3rem;
}
.proof-stat { flex: 1; text-align: center; }
.stat-number {
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.6rem;
}
.stat-label { font-size: 0.82rem; color: var(--fg-secondary); line-height: 1.5; max-width: 180px; margin: 0 auto; }
.proof-divider { width: 1px; height: 60px; background: var(--border); flex-shrink: 0; }

/* ── SECTION SHARED ── */
.section-title {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

/* ── HOW ── */
.how { padding: 5rem 2rem; border-bottom: 1px solid var(--border); }
.how .section-title { max-width: 1100px; margin: 0 auto 3rem; }
.how-steps {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.step { padding: 1.5rem; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; }
.step-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 1.2rem;
}
.step-title {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.75rem;
}
.step-desc { font-size: 0.875rem; color: var(--fg-secondary); line-height: 1.65; }

/* ── OUTPUT ── */
.output { padding: 5rem 2rem; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.output-inner { max-width: 1100px; margin: 0 auto; }
.output-inner .section-title { margin-bottom: 2.5rem; }
.output-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.output-card { padding: 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; }
.output-icon { color: var(--accent); margin-bottom: 1rem; }
.output-title { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; color: var(--fg); margin-bottom: 0.6rem; }
.output-desc { font-size: 0.82rem; color: var(--fg-secondary); line-height: 1.6; }

/* ── BENCHMARKS ── */
.benchmarks { padding: 5rem 2rem; border-bottom: 1px solid var(--border); }
.benchmarks-inner { max-width: 1100px; margin: 0 auto; }
.benchmarks-sub { font-size: 0.95rem; color: var(--fg-secondary); max-width: 560px; margin-bottom: 2.5rem; line-height: 1.6; }
.benchmark-list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 1.5rem; }
.benchmark-item {
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.benchmark-item:last-child { border-bottom: none; }
.benchmark-name { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; color: var(--fg); min-width: 100px; }
.benchmark-domain { font-size: 0.82rem; color: var(--fg-secondary); flex: 1; }
.benchmark-score { font-family: var(--font-mono); font-size: 1rem; font-weight: 700; color: var(--accent); }
.benchmarks-note { font-size: 0.8rem; color: var(--fg-muted); font-style: italic; font-family: var(--font-mono); }

/* ── CLOSING ── */
.closing { padding: 6rem 2rem; background: linear-gradient(180deg, var(--bg) 0%, #080c14 100%); }
.closing-inner { max-width: 1100px; margin: 0 auto; text-align: center; }
.closing-headline { font-family: var(--font-mono); font-size: clamp(1.4rem, 2.5vw, 2.1rem); font-weight: 600; color: var(--fg); line-height: 1.3; letter-spacing: -0.02em; margin-bottom: 1rem; max-width: 700px; margin-left: auto; margin-right: auto; }
.closing-sub { font-size: 1rem; color: var(--fg-secondary); max-width: 480px; margin: 0 auto; line-height: 1.6; }

/* ── FOOTER ── */
.footer { padding: 2rem; border-top: 1px solid var(--border); }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.footer-logo { font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; color: var(--accent); }
.footer-tagline { font-size: 0.78rem; color: var(--fg-muted); margin-left: 0.75rem; }
.footer-meta { font-family: var(--font-mono); font-size: 0.7rem; color: var(--fg-muted); }

/* ── NAV EXTRAS ── */
.nav-right { display: flex; align-items: center; gap: 1.5rem; }
.nav-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity 0.15s;
}
.nav-link:hover { opacity: 0.75; }

/* ── AUDIT FORM ── */
.audit-form-section {
  padding: 5rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.audit-form-inner { max-width: 640px; margin: 0 auto; }
.audit-form-sub {
  font-size: 0.95rem;
  color: var(--fg-secondary);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}
.form-group { margin-bottom: 1.5rem; }
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}
.form-optional { color: var(--fg-muted); font-weight: 400; }
.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--fg-muted); }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237a8aa3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}
.form-select option { background: var(--bg); color: var(--fg); }
.form-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--fg-muted);
  margin-top: 0.35rem;
}
.form-actions { margin-top: 2rem; }
.btn-audit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
}
.btn-audit:hover { opacity: 0.85; }
.btn-audit:disabled { opacity: 0.5; cursor: wait; }
.btn-loading { display: inline-flex; align-items: center; gap: 0.5rem; }
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(10,14,26,0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.audit-error {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 6px;
  color: #ef4444;
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

/* ── RESULT PAGE ── */
.result-page { padding: 3rem 2rem 4rem; }
.result-inner { max-width: 800px; margin: 0 auto; }

.result-header { margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.result-header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.result-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.result-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-muted); }
.result-title { margin-bottom: 1rem; }
.verdict-badge {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 0.3rem 1rem;
  border-radius: 6px;
}
.verdict-pass { background: rgba(34,197,94,0.15); color: #22c55e; }
.verdict-partial { background: rgba(245,158,11,0.15); color: #f59e0b; }
.verdict-fail { background: rgba(239,68,68,0.15); color: #ef4444; }
.verdict-incomplete { background: rgba(122,138,163,0.15); color: var(--fg-secondary); }
.result-verdict-explain { font-size: 0.95rem; color: var(--fg-secondary); line-height: 1.6; margin-bottom: 1.5rem; }

.result-meta { display: flex; flex-direction: column; gap: 0.5rem; }
.meta-item { display: flex; align-items: baseline; gap: 0.75rem; }
.meta-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  min-width: 80px;
  flex-shrink: 0;
}
.meta-value { font-size: 0.82rem; color: var(--fg-secondary); overflow-wrap: break-word; word-break: break-all; }
.meta-link { color: var(--accent); text-decoration: none; }
.meta-link:hover { text-decoration: underline; }

/* ── AUDIT MODE BANNER ── */
.audit-mode-banner {
  margin-bottom: 2rem;
  border-radius: 6px;
  border: 1px solid;
  overflow: hidden;
}
.audit-mode-full {
  background: rgba(0, 229, 200, 0.08);
  border-color: rgba(0, 229, 200, 0.2);
}
.audit-mode-docs-only,
.audit-mode-docs-only-fallback {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}
.audit-mode-inner {
  padding: 0.75rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.audit-mode-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.audit-mode-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--fg);
}
.audit-mode-sep {
  font-size: 0.7rem;
  color: var(--fg-muted);
  margin: 0 0.25rem;
}
.audit-mode-limitation {
  padding: 0.6rem 1.2rem;
  border-top: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.05);
}
.audit-mode-limitation-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #f59e0b;
  font-style: italic;
}

/* ── RESULT SECTIONS ── */
.result-section { margin-bottom: 2.5rem; }
.result-section-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

/* ── SCORES ── */
.scores-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.score-row { display: grid; grid-template-columns: 180px 1fr 40px; gap: 0.75rem; align-items: center; }
.score-label { font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-secondary); }
.score-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}
.score-fill-low { background: var(--high); }
.score-fill-med { background: var(--med); }
.score-fill-high { background: var(--accent); }
.score-value { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600; color: var(--fg); text-align: right; }
.score-reason {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: -0.3rem;
  margin-bottom: 0.5rem;
  padding-left: 0;
}

/* ── FINDINGS CARDS ── */
.findings-list { display: flex; flex-direction: column; gap: 1rem; }
.finding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
}
.finding-card-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.finding-badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  flex-shrink: 0;
}
.badge-critical { background: rgba(239,68,68,0.2); color: #ef4444; }
.badge-high { background: rgba(239,68,68,0.15); color: #ef4444; }
.badge-medium { background: rgba(245,158,11,0.15); color: #f59e0b; }
.badge-low { background: rgba(34,197,94,0.15); color: #22c55e; }
.badge-unknown { background: rgba(122,138,163,0.15); color: var(--fg-secondary); }
.finding-card-title { font-family: var(--font-mono); font-size: 0.88rem; font-weight: 600; color: var(--fg); }
.finding-field { margin-bottom: 0.75rem; }
.finding-field:last-child { margin-bottom: 0; }
.finding-field-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.25rem;
}
.finding-field-text { font-size: 0.82rem; color: var(--fg-secondary); line-height: 1.55; }
.finding-fix { background: var(--accent-dim); padding: 0.75rem; border-radius: 6px; }
.finding-fix .finding-field-label { color: var(--accent); }

/* ── BENCHMARK COMPARISON ── */
.comparison-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--fg-secondary);
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ── RISKS ── */
.risks-list { display: flex; flex-direction: column; gap: 1rem; }
.risk-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--alarm);
  border-radius: 8px;
  padding: 1.2rem;
}
.risk-title { font-family: var(--font-mono); font-size: 0.88rem; font-weight: 600; color: var(--alarm); margin-bottom: 0.75rem; }
.risk-field { margin-bottom: 0.5rem; }
.risk-field:last-child { margin-bottom: 0; }
.risk-field-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.2rem;
}
.risk-field p { font-size: 0.82rem; color: var(--fg-secondary); line-height: 1.55; }

/* ── FIX TABLE ── */
.fix-table {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.fix-table-header, .fix-table-row {
  display: grid;
  grid-template-columns: 60px 1fr 150px 80px;
  gap: 1rem;
  padding: 0.75rem 1.2rem;
  align-items: center;
}
.fix-table-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.fix-table-row { border-bottom: 1px solid var(--border); font-size: 0.82rem; color: var(--fg-secondary); }
.fix-table-row:last-child { border-bottom: none; }
.fix-priority-p0 { font-family: var(--font-mono); font-weight: 700; color: #ef4444; }
.fix-priority-p1 { font-family: var(--font-mono); font-weight: 700; color: #f59e0b; }
.fix-priority-p2 { font-family: var(--font-mono); font-weight: 700; color: var(--accent); }

/* ── RAW OUTPUT ── */
.toggle-raw {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
  margin-bottom: 1rem;
}
.toggle-raw:hover { border-color: var(--fg-muted); }
.raw-output {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-secondary);
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 600px;
  overflow-y: auto;
  margin-top: 1rem;
}

.result-footer-actions { margin-top: 3rem; text-align: center; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-headline { font-size: 2.2rem; }
  .hero-right { display: none; }
  .proof-inner { flex-direction: column; gap: 1.5rem; }
  .proof-divider { display: none; }
  .how-steps { grid-template-columns: 1fr; }
  .output-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 0.75rem; text-align: center; }
  .benchmark-item { flex-wrap: wrap; }
  .score-row { grid-template-columns: 1fr 1fr 40px; }
  .score-label { grid-column: 1 / -1; }
  .fix-table-header, .fix-table-row { grid-template-columns: 50px 1fr; }
  .fix-col-impact, .fix-col-effort { display: none; }
  .nav-tag { display: none; }
}

@media (max-width: 480px) {
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .how, .output, .benchmarks, .closing, .audit-form-section { padding: 3.5rem 1.25rem; }
  .proof { padding: 2rem 1.25rem; }
  .result-page { padding: 2rem 1.25rem; }
}