/* Inbound Webhub — Portal Audit. "Forensic ledger" design system. */
:root {
  --paper: #faf6ee;
  --paper-2: #f3ecdf;
  --ink: #14202e;
  --ink-soft: #45505e;
  --ink-faint: #8a93a0;
  --rule: #d9d0bf;
  --coral: #ff5c35;
  --coral-deep: #d8431f;
  --pass: #0e7c5b;
  --warn: #a87508;
  --fail: #c22f2f;
  --na: #8a93a0;
  --serif: "Fraunces", "Georgia", serif;
  --sans: "Archivo", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", "Menlo", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* subtle ruled-paper texture */
  background-image:
    linear-gradient(0deg, rgba(20,32,46,0.025) 1px, transparent 1px);
  background-size: 100% 32px;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 28px; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 28px; }

/* ---------- header ---------- */
.masthead {
  border-bottom: 3px double var(--ink);
  padding: 18px 0 14px;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.brand { font-family: var(--serif); font-weight: 900; font-size: 21px; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.brand em { color: var(--coral); font-style: normal; }
.masthead .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 40px; position: relative; }
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 6.2vw, 72px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 13ch;
}
.hero h1 .flag { color: var(--coral); }
.hero .lede { margin-top: 22px; font-size: 20px; color: var(--ink-soft); max-width: 54ch; }
.hero .lede strong { color: var(--ink); }

.stamp {
  position: absolute; right: 24px; top: 56px;
  width: 148px; height: 148px; border: 4px solid var(--coral);
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: rotate(9deg);
  color: var(--coral);
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 11px; text-align: center; gap: 2px;
  opacity: 0.9;
  animation: stampIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) 0.3s both;
}
.stamp b { font-size: 40px; font-family: var(--serif); letter-spacing: 0; line-height: 1; }
@keyframes stampIn { from { transform: rotate(9deg) scale(2.4); opacity: 0; } to { transform: rotate(9deg) scale(1); opacity: 0.9; } }
@media (max-width: 860px) { .stamp { display: none; } }

.proof-row {
  margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.proof { padding: 20px 22px; border-left: 1px solid var(--rule); }
.proof:first-child { border-left: none; padding-left: 0; }
.proof .n { font-family: var(--mono); font-size: 30px; font-weight: 600; color: var(--ink); }
.proof .l { font-size: 13.5px; color: var(--ink-soft); margin-top: 2px; }
@media (max-width: 720px) { .proof-row { grid-template-columns: 1fr; } .proof { border-left: none; border-top: 1px solid var(--rule); padding-left: 0; } .proof:first-child { border-top: none; } }

.trust {
  margin-top: 26px; display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em;
  border: 1.5px solid var(--pass); color: var(--pass);
  padding: 8px 14px; border-radius: 999px; background: rgba(14,124,91,0.06);
}

/* ---------- ledger sample ---------- */
.section-title { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 18px; }
.ledger-sample { margin: 64px 0; }
.ledger {
  border: 1.5px solid var(--ink); background: #fffdf8;
  box-shadow: 6px 6px 0 rgba(20,32,46,0.12);
}
.ledger-head {
  display: flex; justify-content: space-between; padding: 12px 18px;
  border-bottom: 1.5px solid var(--ink);
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
}
.ledger-row {
  display: flex; align-items: baseline; gap: 12px; padding: 13px 18px;
  border-bottom: 1px dashed var(--rule); font-size: 15.5px;
}
.ledger-row:last-child { border-bottom: none; }
.ledger-row .dots { flex: 1; border-bottom: 2px dotted var(--rule); transform: translateY(-4px); }
.ledger-row .amt { font-family: var(--mono); font-weight: 600; }

/* ---------- status chips ---------- */
.chip {
  display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; padding: 3px 10px; border-radius: 3px; text-transform: uppercase;
  border: 1.5px solid currentColor;
}
.chip.PASS { color: var(--pass); background: rgba(14,124,91,0.07); }
.chip.WARN { color: var(--warn); background: rgba(168,117,8,0.08); }
.chip.FAIL { color: var(--fail); background: rgba(194,47,47,0.07); }
.chip.NA, .chip.ERROR { color: var(--na); background: rgba(138,147,160,0.1); }

/* ---------- form ---------- */
.form-panel {
  margin: 72px 0 96px; border: 2px solid var(--ink); background: #fffdf8;
  box-shadow: 10px 10px 0 var(--coral);
  padding: 42px 44px;
}
.form-panel h2 { font-family: var(--serif); font-weight: 900; font-size: 34px; letter-spacing: -0.02em; }
.form-panel .sub { color: var(--ink-soft); margin: 8px 0 28px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 14px; font-size: 16px; font-family: var(--sans);
  border: 1.5px solid var(--ink); border-radius: 4px; background: var(--paper);
  color: var(--ink); transition: box-shadow 0.15s ease;
}
.field input:focus, .field select:focus { outline: none; box-shadow: 3px 3px 0 rgba(255,92,53,0.55); }
.field .hint { font-size: 12.5px; color: var(--warn); margin-top: 5px; display: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } .form-panel { padding: 28px 22px; } }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-soft); margin: 22px 0; }
.consent input { margin-top: 3px; accent-color: var(--coral); }

.btn {
  display: inline-block; font-family: var(--sans); font-weight: 700; font-size: 17px;
  background: var(--coral); color: #fff; border: 2px solid var(--ink);
  padding: 14px 30px; cursor: pointer; text-decoration: none; border-radius: 4px;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); background: var(--coral-deep); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.secondary { background: transparent; color: var(--ink); }
.btn-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* ---------- progress ---------- */
.progress-stage { padding: 90px 0 120px; text-align: center; }
.progress-stage h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(30px, 4.5vw, 44px); letter-spacing: -0.02em; }
.scanline {
  margin: 44px auto 20px; max-width: 560px; height: 14px;
  border: 1.5px solid var(--ink); background: #fffdf8; border-radius: 999px; overflow: hidden;
}
.scanline > div {
  height: 100%; background: repeating-linear-gradient(-45deg, var(--coral) 0 10px, var(--coral-deep) 10px 20px);
  width: 3%; transition: width 0.7s ease;
}
.progress-label { font-family: var(--mono); font-size: 14px; color: var(--ink-soft); min-height: 24px; }
.progress-pct { font-family: var(--mono); font-size: 60px; font-weight: 600; margin-top: 24px; }
.progress-pct::after { content: "%"; font-size: 26px; color: var(--ink-faint); }

/* ---------- summary / report ---------- */
.report-cover { padding: 56px 0 24px; border-bottom: 3px double var(--ink); position: relative; }
.report-cover .meta { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 18px; }
.report-cover h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(34px, 5vw, 56px); letter-spacing: -0.03em; line-height: 1.05; max-width: 18ch; }

.grade-block { display: grid; grid-template-columns: auto 1fr; gap: 44px; align-items: center; padding: 40px 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 720px) { .grade-block { grid-template-columns: 1fr; } }
.grade-stamp {
  width: 168px; height: 168px; border: 5px solid; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transform: rotate(-7deg); font-family: var(--mono);
  animation: stampIn2 0.45s cubic-bezier(0.2,1.5,0.4,1) 0.2s both;
}
@keyframes stampIn2 { from { transform: rotate(-7deg) scale(2); opacity: 0; } to { transform: rotate(-7deg) scale(1); opacity: 1; } }
.grade-stamp .g { font-family: var(--serif); font-weight: 900; font-size: 84px; line-height: 0.9; }
.grade-stamp .s { font-size: 13px; letter-spacing: 0.12em; margin-top: 6px; }
.grade-A, .grade-B { color: var(--pass); }
.grade-C { color: var(--warn); }
.grade-D, .grade-F { color: var(--fail); }

.waste-line { font-family: var(--serif); font-size: clamp(24px, 3.4vw, 36px); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.waste-line .money { color: var(--coral-deep); font-weight: 900; white-space: nowrap; }
.waste-note { font-family: var(--mono); font-size: 12px; color: var(--ink-faint); margin-top: 10px; }

.two-col { display: grid; grid-template-columns: 380px 1fr; gap: 48px; padding: 44px 0; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.cat-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.cat-table th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); text-align: left; padding: 8px 10px; border-bottom: 1.5px solid var(--ink); }
.cat-table td { padding: 10px; border-bottom: 1px dashed var(--rule); }
.cat-table .score { font-family: var(--mono); font-weight: 600; text-align: right; }

.findings { padding: 20px 0 60px; }
.cat-section { margin-top: 46px; }
.cat-section > h2 { font-family: var(--serif); font-weight: 900; font-size: 27px; letter-spacing: -0.02em; border-bottom: 2px solid var(--ink); padding-bottom: 10px; display: flex; justify-content: space-between; align-items: baseline; }
.cat-section > h2 .cat-score { font-family: var(--mono); font-size: 17px; font-weight: 600; color: var(--ink-soft); }
.check {
  padding: 20px 0; border-bottom: 1px dashed var(--rule);
  display: grid; grid-template-columns: 92px 1fr; gap: 18px; align-items: start;
}
.check h3 { font-size: 17.5px; font-weight: 700; letter-spacing: -0.01em; }
.check .id { font-family: var(--mono); color: var(--ink-faint); font-weight: 400; margin-right: 6px; font-size: 14px; }
.check .finding { margin-top: 6px; color: var(--ink-soft); font-size: 15.5px; }
.check .fix { margin-top: 12px; padding: 13px 16px; background: var(--paper-2); border-left: 3px solid var(--coral); font-size: 15px; }
.check .fix b { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--coral-deep); display: block; margin-bottom: 5px; }

.top-findings { counter-reset: tf; margin-top: 22px; }
.tf {
  display: grid; grid-template-columns: 54px 1fr; gap: 16px; padding: 18px 0;
  border-bottom: 1px dashed var(--rule); align-items: start;
}
.tf::before {
  counter-increment: tf; content: "0" counter(tf);
  font-family: var(--serif); font-weight: 900; font-size: 38px; color: var(--coral); line-height: 1;
}
.tf h3 { font-size: 17px; } .tf p { color: var(--ink-soft); font-size: 15px; margin-top: 4px; }

.cta-band {
  margin: 70px 0; border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  padding: 44px 46px; box-shadow: 10px 10px 0 var(--coral); position: relative; overflow: hidden;
}
.cta-band h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(26px, 3.6vw, 38px); letter-spacing: -0.02em; max-width: 22ch; }
.cta-band p { color: #b9c2cf; margin: 12px 0 26px; max-width: 52ch; }
.cta-band .btn { box-shadow: 4px 4px 0 rgba(250,246,238,0.9); border-color: var(--paper); }

.footer { border-top: 3px double var(--ink); padding: 26px 0 60px; font-size: 13px; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer a { color: var(--ink-soft); }

/* reveal on load */
.reveal { animation: rise 0.6s ease both; }
.reveal:nth-child(2) { animation-delay: 0.08s; } .reveal:nth-child(3) { animation-delay: 0.16s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- print (PDF via print-to-PDF / headless Chrome) ---------- */
@media print {
  body { background: #fff; font-size: 12.5px; }
  .no-print, .cta-band .btn { display: none !important; }
  .ledger, .form-panel { box-shadow: none; }
  .cat-section { break-inside: avoid-page; }
  .report-cover { padding-top: 10px; }
  .cta-band { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
