:root {
  color-scheme: light dark;
  --bg: #f3f5f6;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --text: #142028;
  --muted: #52616b;
  --soft: #e8edf0;
  --line: #cdd6db;
  --line-strong: #9eacb4;
  --accent: #075cc9;
  --accent-dark: #06499f;
  --accent-soft: #e8f1ff;
  --success: #087443;
  --success-soft: #e6f6ed;
  --warning: #8a5300;
  --warning-soft: #fff1d6;
  --danger: #b4232c;
  --danger-soft: #ffebed;
  --max: 800px;
  --radius: 14px;
  --shadow: 0 18px 45px rgba(25, 43, 54, 0.1), 0 3px 10px rgba(25, 43, 54, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.58;
  text-rendering: optimizeLegibility;
}

button, input, textarea { font: inherit; }
button, label, summary { -webkit-tap-highlight-color: transparent; }

header, main, footer {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto;
}

header { padding: 44px 0 30px; }
main { padding-bottom: 56px; }
footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 24px 0 42px;
  font-size: 14px;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 48px;
}
.nav-links { display: flex; gap: 20px; flex-wrap: wrap; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a:focus-visible, nav a[aria-current="page"] { color: var(--accent); }
.wordmark { color: var(--text); font-weight: 750; letter-spacing: -0.015em; }

h1, h2, h3 {
  color: var(--text);
  line-height: 1.13;
  letter-spacing: -0.028em;
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 8vw, 64px); margin: 0 0 18px; }
h2 { font-size: 26px; margin: 42px 0 14px; }
h3 { font-size: 18px; margin: 28px 0 9px; }
p, ul { margin: 0 0 18px; }
ul { padding-left: 22px; }
.lede { color: var(--muted); font-size: 20px; max-width: 650px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
}
.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: .075em;
  text-transform: uppercase;
}
a { color: var(--accent); text-underline-offset: 3px; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .92em; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Verification workbench */
.verify-page { min-height: 100vh; }
.compact-header { padding-bottom: 0; }
.compact-header nav { margin-bottom: 18px; }
.verify-shell { padding-top: 38px; }
.verify-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 34px;
}
.verify-intro h1 { max-width: 680px; }
.verify-intro .lede { font-size: 19px; }
.local-notice {
  display: flex;
  gap: 13px;
  max-width: 650px;
  margin-top: 14px;
  border-top: 1px solid var(--line-strong);
  padding-top: 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.local-notice svg {
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  fill: none;
  stroke: var(--success);
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.local-notice p { margin: 0; }
.local-notice strong { display: block; color: var(--text); }

.verifier {
  position: relative;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 360px;
  overflow: hidden;
}
.drop-zone {
  min-height: 360px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 25px;
  padding: 44px;
  cursor: pointer;
  background: var(--surface);
  transition: background-color 180ms ease, box-shadow 180ms ease;
}
.drop-zone:hover, .drop-zone.is-dragging {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.drop-symbol {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--accent);
}
.drop-symbol svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-copy { display: grid; gap: 4px; }
.drop-copy strong { font-size: clamp(25px, 4vw, 34px); letter-spacing: -0.025em; }
.drop-copy span { color: var(--muted); }
.file-note {
  grid-column: 2;
  justify-self: start;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.camera-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 12px 44px;
  color: var(--muted);
  font-size: 14px;
}
.camera-choice .text-button { padding-block: 6px; }
.camera-panel {
  grid-template-columns: minmax(260px, 1.15fr) minmax(240px, .85fr);
  gap: 34px;
  align-items: center;
  padding: 42px;
  min-height: 450px;
}
.camera-panel:not([hidden]) { display: grid; }
.camera-frame {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  border-radius: 12px;
  background: #0b0f11;
}
.camera-frame video { width: 100%; height: 100%; min-height: 360px; display: block; object-fit: cover; }
.scan-guide {
  position: absolute;
  width: min(62%, 280px);
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(5, 12, 16, .38);
}
.camera-copy strong { display: block; font-size: 22px; line-height: 1.25; margin-bottom: 8px; }
.camera-copy p { color: var(--muted); font-size: 15px; line-height: 1.5; }

.proof-entry {
  border-top: 1px solid var(--line);
  padding: 0 44px;
}
.proof-entry summary {
  width: max-content;
  max-width: 100%;
  padding: 18px 0;
  color: var(--accent);
  cursor: pointer;
  font-weight: 650;
}
.proof-entry form { display: grid; gap: 12px; padding: 4px 0 28px; }
.proof-entry label { font-size: 14px; font-weight: 650; }
.proof-entry textarea {
  width: 100%;
  resize: vertical;
  min-height: 104px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  padding: 13px 14px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  line-height: 1.45;
}

.button {
  width: max-content;
  min-height: 46px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  font-weight: 720;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(7, 92, 201, .18);
  transition: background-color 160ms ease, transform 160ms cubic-bezier(.2, .8, .2, 1);
}
.button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.secondary-button { box-shadow: none; }
.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 10px 2px;
  cursor: pointer;
  font-weight: 650;
}

.working-panel {
  min-height: 420px;
  place-content: center;
  grid-template-columns: 34px minmax(0, 390px);
  gap: 18px;
  padding: 48px;
}
.working-panel:not([hidden]) { display: grid; }
.working-panel strong { display: block; font-size: 22px; margin-bottom: 4px; }
.working-panel p { color: var(--muted); margin: 0; }
.working-mark {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-panel { outline: none; }
.result-banner {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 20px;
  padding: 38px 42px 34px;
  border-bottom: 1px solid var(--line);
}
.result-symbol {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
}
.result-kicker {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 760;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.result-banner h2 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 40px); }
.result-banner p:last-child { max-width: 700px; margin: 0; }
.result-verified { background: var(--success-soft); }
.result-verified .result-symbol { background: var(--success); color: #fff; }
.result-verified .result-kicker { color: var(--success); }
.result-proofOnly { background: var(--warning-soft); }
.result-proofOnly .result-symbol { background: var(--warning); color: #fff; }
.result-proofOnly .result-kicker { color: var(--warning); }
.result-unconfirmed { background: var(--warning-soft); }
.result-unconfirmed .result-symbol { background: var(--warning); color: #fff; }
.result-unconfirmed .result-kicker { color: var(--warning); }
.result-tampered, .result-error { background: var(--danger-soft); }
.result-tampered .result-symbol, .result-error .result-symbol { background: var(--danger); color: #fff; }
.result-tampered .result-kicker, .result-error .result-kicker { color: var(--danger); }
.result-noProof { background: var(--soft); }
.result-noProof .result-symbol { background: var(--muted); color: #fff; }
.result-noProof .result-kicker { color: var(--muted); }

.file-context {
  align-items: center;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 16px;
  margin: 28px 42px 0;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.file-context:not([hidden]) { display: grid; }
.file-context img { width: 66px; height: 66px; object-fit: cover; border-radius: 8px; background: var(--soft); }
.file-context strong, .file-context span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-context span { color: var(--muted); font-size: 14px; margin-top: 2px; }

.checks-section, .record-section { padding: 0 42px; }
.checks-section h3, .record-section h3 { margin-top: 30px; }
.checks-list { border-top: 1px solid var(--line); }
.check-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 13px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.check-mark {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
}
.check-pass .check-mark { background: var(--success-soft); color: var(--success); }
.check-fail .check-mark { background: var(--danger-soft); color: var(--danger); }
.check-neutral .check-mark { background: var(--soft); color: var(--muted); }
.check-row strong { font-size: 16px; }
.check-row p { margin: 3px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; }

.section-heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.record-version { color: var(--muted); font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.record-list {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) minmax(0, 1.3fr);
  margin: 0;
  border-top: 1px solid var(--line);
}
.record-list dt, .record-list dd { margin: 0; padding: 13px 0; border-bottom: 1px solid var(--line); }
.record-list dt { color: var(--muted); padding-right: 20px; }
.record-list dd { overflow-wrap: anywhere; }
.record-list .data-value { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 14px; }
.result-actions { display: flex; align-items: center; gap: 22px; padding: 34px 42px 42px; }

.meaning { margin: 72px 0 28px; }
.meaning > h2 { font-size: 32px; margin-bottom: 24px; }
.meaning-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  border-top: 1px solid var(--line-strong);
}
.meaning-grid h3 { margin-top: 20px; }
.meaning-grid p { color: var(--muted); font-size: 15px; line-height: 1.5; }

@media (max-width: 760px) {
  .drop-zone { grid-template-columns: 62px minmax(0, 1fr); min-height: 310px; padding: 34px; }
  .drop-symbol { width: 62px; height: 62px; }
  .drop-symbol svg { width: 34px; height: 34px; }
  .file-note { grid-column: 2; justify-self: start; }
  .camera-choice { padding-inline: 34px; }
  .camera-panel { grid-template-columns: 1fr; }
  .proof-entry { padding-inline: 34px; }
  .meaning-grid { grid-template-columns: 1fr; gap: 0; }
  .meaning-grid > div { border-bottom: 1px solid var(--line); }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  header, main, footer { width: calc(100% - 28px); }
  header { padding-top: 26px; }
  nav { align-items: flex-start; margin-bottom: 34px; }
  .nav-links { justify-content: flex-end; gap: 12px 16px; font-size: 14px; }
  .verify-shell { padding-top: 24px; }
  .verify-intro { margin-bottom: 24px; }
  .verify-intro h1 { font-size: 42px; }
  .verify-intro .lede { font-size: 17px; }
  .drop-zone { grid-template-columns: 1fr; align-content: center; gap: 16px; min-height: 340px; padding: 32px 24px; text-align: center; }
  .drop-symbol, .file-note { justify-self: center; }
  .file-note { grid-column: 1; }
  .camera-choice { align-items: flex-start; flex-direction: column; gap: 2px; padding: 14px 24px; }
  .camera-panel { padding: 24px; }
  .camera-frame, .camera-frame video { min-height: 320px; }
  .proof-entry { padding-inline: 24px; }
  .working-panel { grid-template-columns: 28px minmax(0, 1fr); padding: 34px 24px; }
  .result-banner { grid-template-columns: 42px minmax(0, 1fr); gap: 14px; padding: 28px 24px; }
  .result-symbol { width: 40px; height: 40px; font-size: 22px; }
  .file-context { margin-inline: 24px; }
  .checks-section, .record-section { padding-inline: 24px; }
  .record-list { grid-template-columns: 1fr; }
  .record-list dt { border-bottom: 0; padding-bottom: 2px; }
  .record-list dd { padding-top: 0; }
  .result-actions { align-items: flex-start; flex-direction: column; gap: 8px; padding: 28px 24px 34px; }
  .meaning { margin-top: 54px; }
}

@media (max-width: 380px) {
  nav { align-items: flex-start; flex-direction: column; gap: 12px; }
  .nav-links { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10171b;
    --surface: #172126;
    --surface-raised: #172126;
    --text: #f1f5f7;
    --muted: #a8b5bc;
    --soft: #233138;
    --line: #33434b;
    --line-strong: #566871;
    --accent: #78b1ff;
    --accent-dark: #9ac5ff;
    --accent-soft: #162d48;
    --success: #72d6a7;
    --success-soft: #163a2b;
    --warning: #ffc46b;
    --warning-soft: #3b2d16;
    --danger: #ff9da4;
    --danger-soft: #402024;
    --shadow: 0 18px 45px rgba(0, 0, 0, .26), 0 3px 10px rgba(0, 0, 0, .18);
  }
  .button { color: #092039; box-shadow: none; }
}
