:root {
  color-scheme: light;
  --ink: #161616;
  --muted: #626a73;
  --paper: #fffdf8;
  --panel: #ffffff;
  --line: #d8d2c4;
  --line-dark: #b9ad99;
  --accent: #0d6b57;
  --accent-dark: #094a3d;
  --accent-soft: #e6f2ee;
  --warn: #b42318;
  --warn-soft: #fff0ec;
  --ok: #126c3a;
  --ok-soft: #e8f5ed;
  --gold: #a8731a;
  --shadow: 0 24px 70px rgba(30, 25, 16, 0.12);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Aptos", "Segoe UI", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(22,22,22,.035) 1px, transparent 1px),
    linear-gradient(180deg, #fffdf8 0%, #f6f1e8 100%);
  background-size: 44px 44px, auto;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-dark);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 66px;
  padding: 0 clamp(18px, 4.5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 19px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  font-weight: 700;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px clamp(18px, 4.5vw, 64px) 72px;
}

.notice {
  margin-bottom: 24px;
  padding: 14px 18px;
  border: 1px solid #d79822;
  background: #fff6dd;
  color: #7c520c;
}

.kicker {
  margin: 0 0 14px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.84fr);
  gap: clamp(28px, 5vw, 68px);
  align-items: center;
}

.hero-copy h1,
.result-header h1 {
  margin: 0;
  max-width: 780px;
  font-family: var(--serif);
  font-size: clamp(42px, 7vw, 86px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.lede {
  max-width: 650px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.proof-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 650px;
  margin: 34px 0 0;
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}

.proof-strip div {
  padding: 16px 18px 16px 0;
}

.proof-strip div + div {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.proof-strip dt {
  margin: 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}

.proof-strip dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.upload-panel {
  position: relative;
  padding: 26px;
  border: 1px solid var(--line-dark);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.upload-panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--line);
  pointer-events: none;
}

.upload-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.file-drop {
  display: grid;
  min-height: 250px;
  place-items: center;
  padding: 34px 22px;
  border: 2px dashed var(--line-dark);
  background: linear-gradient(180deg, #fffdf8 0%, #f8f3ea 100%);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.file-drop:hover,
.file-drop.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.file-drop-icon {
  display: grid;
  width: 82px;
  height: 98px;
  place-items: center;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 8px 8px 0 #e8dfcf;
}

.file-drop strong {
  display: block;
  margin-top: 22px;
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.1;
}

.file-drop small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.file-name {
  display: none;
  max-width: 100%;
  margin-top: 14px;
  padding: 9px 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.file-drop.has-file .file-name {
  display: inline-block;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, background .16s ease, color .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
}

.btn-primary:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.btn-outline {
  background: var(--paper);
}

.btn.compact {
  min-width: 220px;
}

.upload-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.audit-preview,
.section,
.source-card,
.integrity,
.result-header,
.report-grid {
  margin-top: 72px;
}

.audit-preview {
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(360px, 1fr);
  gap: 34px;
  align-items: start;
  padding-top: 42px;
  border-top: 1px solid var(--line-dark);
}

.preview-copy h2,
.section-head h2,
.source-card h2,
.integrity h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.025em;
}

.preview-copy p:not(.kicker),
.source-card p,
.integrity p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.report-mock {
  border: 1px solid var(--line-dark);
  background: var(--panel);
  box-shadow: 14px 14px 0 #e8dfcf;
}

.mock-header,
.mock-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
}

.mock-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 900;
}

.mock-header strong {
  color: var(--warn);
}

.mock-issue {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.severity {
  display: inline-flex;
  padding: 3px 8px;
  background: var(--warn-soft);
  color: var(--warn);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.mock-issue h3 {
  margin: 10px 0 12px;
  font-size: 20px;
}

.compare,
.expected-found {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.compare p,
.expected-found p {
  margin: 0;
  padding: 12px;
  background: #f8f3ea;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
}

.compare b,
.expected-found b {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
}

.dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}

.card,
.source-card,
.integrity,
.report-panel {
  border: 1px solid var(--line-dark);
  background: var(--panel);
}

.card {
  padding: 24px;
}

.card h3 {
  margin: 0 0 14px;
  font-size: 19px;
}

.card ul {
  margin: 0;
  padding-left: 20px;
}

.card li {
  margin: 10px 0;
  color: var(--muted);
}

.source-card {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
  gap: 28px;
  padding: 30px;
}

.integrity {
  padding: 26px 30px;
  background: #fff7dd;
}

.site-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px clamp(18px, 4.5vw, 64px) 42px;
  color: var(--muted);
  font-size: 13px;
}

.result-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line-dark);
}

.result-header h1 {
  font-size: clamp(34px, 5vw, 62px);
  overflow-wrap: anywhere;
}

.result-stats {
  display: flex;
  gap: 12px;
}

.stat-box {
  min-width: 118px;
  padding: 16px;
  border: 1px solid var(--line-dark);
  background: var(--panel);
  text-align: center;
}

.stat-value {
  display: block;
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
}

.stat-box.fail .stat-value {
  color: var(--warn);
}

.stat-box.pass .stat-value {
  color: var(--ok);
}

.stat-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .38fr);
  gap: 20px;
  align-items: start;
}

.report-panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 0;
}

.summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

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

.issue-list li {
  padding: 16px;
  border: 1px solid var(--line);
  background: #fffbf2;
}

.issue-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.location,
.empty,
.repair-note {
  color: var(--muted);
}

.repair-panel {
  position: sticky;
  top: 88px;
}

.repair-status {
  display: grid;
  place-items: center;
  padding: 24px;
  margin: 18px 0 14px;
  background: var(--ok-soft);
}

.repair-status strong {
  font-family: var(--serif);
  font-size: 62px;
  line-height: 1;
  color: var(--ok);
}

.repair-status span {
  color: var(--muted);
  font-weight: 900;
}

.repair-note {
  margin: 0 0 18px;
}

@media (max-width: 900px) {
  .hero,
  .audit-preview,
  .dual-grid,
  .source-card,
  .result-header,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .upload-panel {
    order: -1;
  }

  .proof-strip {
    grid-template-columns: 1fr;
  }

  .proof-strip div + div {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .repair-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-nav {
    display: none;
  }

  main {
    padding-top: 30px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .file-drop {
    min-height: 210px;
  }

  .file-drop strong {
    font-size: 23px;
  }

  .compare,
  .expected-found,
  .result-stats {
    grid-template-columns: 1fr;
  }

  .result-stats {
    display: grid;
  }

  .source-card,
  .integrity,
  .card,
  .report-panel,
  .upload-panel {
    padding: 18px;
  }
}
