:root {
  --porcelain: #f8fafc;
  --surface: #ffffff;
  --steel-subtle: #f1f5f9;
  --steel: #cbd5e1;
  --steel-strong: #94a3b8;
  --graphite: #0f172a;
  --ink-body: #334155;
  --slate-muted: #64748b;
  --faema-blue: #1d4ed8;
  --faema-blue-hover: #1e40af;
  --faema-tint: #eff6ff;
  --crema-amber: #b45309;
  --crema-fill: #d97706;
  --ok-green: #15803d;
  --ok-bg: #f0fdf4;
  --warn-amber: #b45309;
  --warn-bg: #fffbeb;
  --risk-red: #b91c1c;
  --risk-bg: #fef2f2;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html {
  background: var(--porcelain);
  color: var(--graphite);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
}

a {
  color: var(--faema-blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--faema-blue-hover);
}

:focus-visible {
  outline: 2px solid var(--faema-blue);
  outline-offset: 2px;
}

.topbar {
  border-bottom: 1px solid var(--steel);
  background: var(--surface);
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--graphite);
}

.brand-mark {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 0.875rem;
  color: var(--slate-muted);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.9rem;
}

.topnav a {
  color: var(--ink-body);
  text-decoration: none;
  font-weight: 500;
}

.topnav a:hover {
  color: var(--faema-blue);
}

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 28px;
  align-items: start;
}

@media (max-width: 880px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.scanner-panel {
  background: var(--surface);
  border: 1px solid var(--steel);
  border-radius: 6px;
  padding: 28px;
}

.scanner-panel h1 {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 2.8vw, 2.2rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  max-width: 28ch;
}

.lead {
  margin: 0 0 22px;
  color: var(--ink-body);
  font-size: 1rem;
  max-width: 62ch;
}

.scan-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.scan-input {
  flex: 1 1 260px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  padding: 11px 14px;
  border: 1px solid var(--steel-strong);
  border-radius: 4px;
  background: var(--porcelain);
  color: var(--graphite);
}

.btn-primary {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 18px;
  border-radius: 4px;
  border: 1px solid var(--faema-blue);
  background: var(--faema-blue);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  background: var(--faema-blue-hover);
  border-color: var(--faema-blue-hover);
  color: #ffffff;
}

.btn-secondary {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 9px 14px;
  border-radius: 4px;
  border: 1px solid var(--steel-strong);
  background: var(--surface);
  color: var(--graphite);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  border-color: var(--graphite);
  color: var(--graphite);
}

.preset-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--slate-muted);
}

.preset-chip {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 4px 9px;
  border: 1px solid var(--steel);
  border-radius: 3px;
  background: var(--porcelain);
  color: var(--ink-body);
  cursor: pointer;
}

.preset-chip:hover {
  border-color: var(--faema-blue);
  color: var(--faema-blue);
}

.cli-hint {
  margin-top: 14px;
  padding: 9px 12px;
  background: var(--steel-subtle);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-body);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.scan-output {
  margin-top: 22px;
  border-top: 1px solid var(--steel);
  padding-top: 20px;
}

.score-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.score-repo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.05rem;
}

.score-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  padding: 4px 10px;
  border-radius: 4px;
}

.score-good {
  background: var(--ok-bg);
  color: var(--ok-green);
}

.score-mid {
  background: var(--warn-bg);
  color: var(--warn-amber);
}

.score-low {
  background: var(--risk-bg);
  color: var(--risk-red);
}

.checks-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  gap: 8px;
}

.checks-list li {
  padding: 9px 12px;
  border: 1px solid var(--steel);
  border-radius: 4px;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--porcelain);
}

.check-pts {
  font-family: var(--font-mono);
  font-weight: 600;
  white-space: nowrap;
}

.generated-box {
  margin-top: 14px;
}

.generated-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.86rem;
  font-weight: 600;
}

pre.code-block {
  margin: 0;
  padding: 14px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 290px;
}

/* Espresso Cup Ledger Aside */
.cup-ledger {
  background: var(--surface);
  border: 2px solid var(--faema-blue);
  border-radius: 6px;
  padding: 24px;
}

.cup-ledger h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
}

.cup-note {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--ink-body);
}

.cup-visual-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
  background: var(--faema-tint);
  border-radius: 5px;
  margin-bottom: 16px;
}

.cup-stats {
  flex: 1;
}

.cup-amount {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--graphite);
}

.cup-goal {
  font-size: 0.83rem;
  color: var(--ink-body);
}

.progress-track {
  margin-top: 8px;
  height: 8px;
  background: #dbeafe;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--crema-fill);
  width: 0%;
  transition: width 0.35s ease;
}

.ledger-kv {
  margin: 0;
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
}

.ledger-kv div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--steel-subtle);
}

.ledger-kv dt {
  color: var(--slate-muted);
}

.ledger-kv dd {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 500;
  text-align: right;
}

/* Sample Audit Proof Banner */
.sample-proof {
  margin-top: 32px;
  background: var(--surface);
  border: 1px solid var(--steel);
  border-left: 4px solid var(--faema-blue);
  border-radius: 4px;
  padding: 22px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sample-proof h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.sample-proof p {
  margin: 0;
  color: var(--ink-body);
  font-size: 0.93rem;
  max-width: 68ch;
}

/* Paid Tiers Section */
.section-block {
  margin-top: 44px;
}

.section-block h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.section-intro {
  margin: 0 0 24px;
  color: var(--ink-body);
  max-width: 68ch;
}

.tiers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

@media (max-width: 920px) {
  .tiers-grid {
    grid-template-columns: 1fr;
  }
}

.tier-card {
  background: var(--surface);
  border: 1px solid var(--steel);
  border-radius: 6px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tier-card.featured {
  border: 2px solid var(--faema-blue);
}

.tier-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tier-price {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 700;
}

.tier-turnaround {
  font-size: 0.8rem;
  color: var(--slate-muted);
}

.tier-card h3 {
  margin: 0 0 10px;
  font-size: 1.12rem;
}

.tier-card p {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: var(--ink-body);
}

.tier-features {
  margin: 0 0 18px;
  padding-left: 18px;
  font-size: 0.88rem;
  color: var(--ink-body);
  display: grid;
  gap: 6px;
}

.intake-fields {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.intake-fields label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--graphite);
}

.intake-fields input {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  padding: 8px 10px;
  border: 1px solid var(--steel-strong);
  border-radius: 4px;
  background: var(--porcelain);
}

.status-callout {
  margin-top: 12px;
  padding: 12px;
  border-radius: 4px;
  background: var(--ok-bg);
  border: 1px solid #86efac;
  font-size: 0.85rem;
  color: var(--graphite);
}

.error-callout {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 4px;
  background: var(--risk-bg);
  border: 1px solid #fca5a5;
  font-size: 0.85rem;
  color: var(--risk-red);
}

/* Report / Article Layout */
.report-article {
  background: var(--surface);
  border: 1px solid var(--steel);
  border-radius: 6px;
  padding: 36px;
  max-width: 860px;
}

.report-article h1 {
  margin-top: 0;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
}

.report-article h2 {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--steel-subtle);
  font-size: 1.28rem;
}

.finding-box {
  margin: 16px 0;
  padding: 16px 18px;
  border: 1px solid var(--steel);
  border-radius: 5px;
  background: var(--porcelain);
}

.finding-severity {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  margin-right: 8px;
}

.sev-p1 {
  background: var(--risk-bg);
  color: var(--risk-red);
}

.sev-p2 {
  background: var(--warn-bg);
  color: var(--warn-amber);
}

.footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--steel);
  font-size: 0.85rem;
  color: var(--slate-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar {
    transition: none;
  }
}
