:root {
  color-scheme: light;
  --navy: #071b2c;
  --navy-soft: #163348;
  --green: #0f9f74;
  --green-dark: #087455;
  --green-pale: #e9f8f2;
  --cream: #f5f3ec;
  --paper: #ffffff;
  --ink: #102331;
  --muted: #5f707b;
  --line: #d7e0e4;
  --danger: #b42318;
  --danger-pale: #fff2f0;
  --shadow: 0 20px 60px rgba(7, 27, 44, .12);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); }
button, input, textarea { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  padding: .7rem 1rem;
  border-radius: .5rem;
  background: var(--paper);
}
.skip-link:focus { top: 1rem; }

.site-header,
.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.15rem 2rem;
  display: flex;
  align-items: center;
}
.site-header { justify-content: flex-start; }
.site-footer {
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .86rem;
}
.site-footer nav { display: flex; gap: 1rem; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--navy);
  text-decoration: none;
}
.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  display: block;
  flex: 0 0 2.5rem;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: url('./proofstamp-logo.svg') center / contain no-repeat;
  color: transparent;
  font-size: 0;
}
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { letter-spacing: -.02em; }
.brand-copy small { margin-top: .18rem; color: var(--muted); font-size: .72rem; }

main { padding-bottom: 1rem; }
.hero {
  max-width: 760px;
  margin: 3.8rem auto 2.2rem;
  padding: 0 2rem;
  text-align: center;
}
.hero h1 {
  margin: 0 0 .75rem;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 7vw, 4.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.04em;
}
.hero > p {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}
.trust-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .55rem 1.25rem;
  padding: 0;
  margin: 1.25rem 0 0;
  list-style: none;
  color: var(--navy-soft);
  font-size: .84rem;
  font-weight: 700;
}
.trust-list span { color: var(--green); margin-right: .28rem; }

.tool-shell {
  position: relative;
  width: min(880px, calc(100% - 2rem));
  margin: 0 auto 4.5rem;
  overflow: hidden;
  border: 1px solid rgba(7, 27, 44, .08);
  border-radius: 1.35rem;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.mode-control {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  background: #f8faf9;
}
.tab {
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: .9rem 1rem;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 750;
  cursor: pointer;
  user-select: none;
}
#mode-create:checked ~ .tabs label[for="mode-create"],
#mode-verify:checked ~ .tabs label[for="mode-verify"] {
  color: var(--navy);
  border-bottom-color: var(--green);
  background: white;
}
#mode-create:focus-visible ~ .tabs label[for="mode-create"],
#mode-verify:focus-visible ~ .tabs label[for="mode-verify"] {
  outline: 3px solid rgba(15, 159, 116, .25);
  outline-offset: -3px;
}
#mode-create:checked ~ #verify-panel,
#mode-verify:checked ~ #create-panel { display: none; }
#mode-create:checked ~ #verification-result[data-source="saved"],
#mode-verify:checked ~ #verification-result[data-source="current"] { display: none !important; }
.tool-shell.saved-result-active #verify-panel { display: none !important; }

.panel { padding: 2rem; }
.stage { min-width: 0; }
.stage + .stage { border-top: 1px solid rgba(7, 27, 44, .08); padding-top: 1.7rem; margin-top: 1.7rem; }
.create-panel:has(#result:not([hidden])) #prepare-stage { display: none; }
.create-panel:has(#timestamp-result:not([hidden])) #result { display: none !important; }

.stage-kicker {
  margin: 0 0 .45rem;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .72rem;
  font-weight: 800;
}
h2 {
  margin: 0 0 .35rem;
  color: var(--navy);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  line-height: 1.15;
  letter-spacing: -.02em;
}
.stage-subcopy,
.verify-intro p,
.explanation p,
.success-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.stage-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

form { margin-top: 1.25rem; }
.field {
  display: grid;
  gap: .42rem;
  margin-bottom: 1rem;
  font-weight: 700;
}
.field small,
.privacy-note,
.warning-note {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.45;
}
em { font-style: normal; font-weight: 400; color: var(--muted); }
input[type=file],
textarea {
  width: 100%;
  min-height: 48px;
  padding: .72rem .78rem;
  border: 1px solid var(--line);
  border-radius: .68rem;
  background: white;
  color: var(--ink);
}
input[type=file]::file-selector-button {
  margin-right: .7rem;
  padding: .58rem .72rem;
  border: 0;
  border-radius: .52rem;
  background: var(--green-pale);
  color: var(--green-dark);
  font-weight: 750;
  cursor: pointer;
}
textarea { resize: vertical; }
input[type=file]:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(15, 159, 116, .16);
  border-color: var(--green);
}
.check {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  font-weight: 650;
}
.check input { margin-top: .25rem; }

button,
.primary,
.secondary,
.text-button {
  border-radius: .68rem;
  font-weight: 750;
  cursor: pointer;
  transition: .15s ease;
}
button {
  border: 0;
  padding: .85rem 1.05rem;
}
.primary {
  background: var(--green);
  color: white;
  box-shadow: 0 8px 20px rgba(15, 159, 116, .2);
}
.primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary:disabled { opacity: .58; cursor: wait; transform: none; }
.secondary {
  background: white;
  color: var(--navy);
  border: 1px solid var(--line);
}
.secondary:hover { border-color: #91a4ac; }
.text-button {
  display: block;
  margin: .7rem auto 0;
  padding: .35rem .2rem;
  background: transparent;
  color: var(--green-dark);
}
.full-button { width: 100%; min-height: 54px; margin-top: 1rem; }
.text-link {
  display: table;
  margin: 1rem auto 0;
  color: var(--green-dark);
  font-weight: 700;
  text-underline-offset: 3px;
}
.actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }

.status {
  min-height: 1.35em;
  margin: .85rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}
.status:empty { display: none; }
.status.error { color: var(--danger); font-weight: 650; }
.ok { margin: 0 0 .25rem; color: var(--green-dark); font-weight: 800; }
.badge {
  display: inline-block;
  white-space: nowrap;
  padding: .4rem .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faf9;
  color: var(--navy-soft);
  font-size: .77rem;
  font-weight: 700;
}

.hash-status {
  margin: .9rem 0 1rem;
  padding: .8rem .9rem;
  border-radius: .8rem;
  background: var(--green-pale);
  color: var(--green-dark);
  line-height: 1.45;
}
.inline-details { margin-top: .45rem; }
.inline-details summary,
.advanced-details > summary,
.nested-details > summary,
.independent-details > summary {
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 750;
}
.inline-details code {
  display: block;
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid rgba(8, 116, 85, .16);
  overflow-wrap: anywhere;
}

.advanced-details {
  margin-top: 1rem;
  padding: .85rem .95rem;
  border: 1px solid rgba(7, 27, 44, .09);
  border-radius: .8rem;
  background: rgba(248, 250, 249, .78);
}
.nested-details { margin-top: .7rem; }
.details { display: grid; gap: 0; margin: .8rem 0 0; }
.details div { padding: .75rem 0; border-top: 1px solid rgba(7, 27, 44, .08); }
dt { margin-bottom: .28rem; color: var(--muted); font-size: .78rem; }
dd { margin: 0; overflow-wrap: anywhere; }
code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .8rem;
}
pre {
  padding: .8rem;
  border-radius: .6rem;
  background: white;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.success-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  margin-bottom: .75rem;
  border-radius: 50%;
  background: var(--green-pale);
  color: var(--green-dark);
  font-weight: 900;
}
.share-note {
  margin-top: 1rem;
  padding: .95rem 1rem;
  border: 1px solid rgba(7, 27, 44, .1);
  border-radius: .8rem;
  background: rgba(255, 255, 255, .7);
}
.share-note p { margin: .25rem 0 0; color: var(--muted); line-height: 1.45; }
.warning-note { margin: .8rem 0 0; }

.verify-intro { margin-bottom: 1.2rem; }
.verify-intro h2 { margin-bottom: .35rem; }
.verify-file-field {
  margin-bottom: .75rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(7, 27, 44, .09);
  border-radius: .85rem;
  background: #fbfcfb;
}
.verify-file-field > span { color: var(--navy); font-size: 1rem; }
.verify-file-field input[type=file] {
  min-height: 44px;
  padding: .25rem 0 0;
  border: 0;
  background: transparent;
}
.verify-privacy { margin: .75rem 0 0; text-align: center; font-size: .84rem; }
.verify-panel.mismatch-active #saved-status {
  display: block;
  margin-top: 1rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(180, 35, 24, .28);
  border-radius: .8rem;
  background: var(--danger-pale);
  color: #8b1d15;
  font-weight: 500;
}
.verify-panel.mismatch-active #saved-status::before {
  content: "File does not match";
  display: block;
  margin-bottom: .2rem;
  font-weight: 800;
}

.result-stage {
  padding: 2rem;
  border-top: 1px solid var(--line);
  background: #fbfcfb;
}
.result-heading { margin-bottom: 1.15rem; }
.verification-checks {
  display: grid;
  gap: .65rem;
  margin: 0 0 1rem;
}
.verification-check {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  gap: .8rem;
  align-items: start;
  padding: .85rem .9rem;
  border: 1px solid rgba(7, 27, 44, .08);
  border-radius: .8rem;
  background: white;
}
.verification-check strong { display: block; color: var(--navy); }
.verification-check small { display: block; margin-top: .15rem; color: var(--muted); line-height: 1.4; }
.verification-check-icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}
.verification-check-icon.verified { background: var(--green-pale); color: var(--green-dark); }
.verification-check-icon.pending { background: #f3f4f4; color: var(--navy-soft); }
.verification-check-icon.neutral { background: #f3f4f4; color: var(--muted); }
#verification-result:not(:has(#verified-file-row:not([hidden]))) .file-match-state { display: none; }
#verification-result:has(#verified-file-row:not([hidden])) .file-unchecked-state { display: none; }
#verification-result:not(:has(#verified-height-row:not([hidden]))) .bitcoin-verified-state { display: none; }
#verification-result:has(#verified-height-row:not([hidden])) .bitcoin-pending-state { display: none; }
#verification-result:has(#verified-height-row:not([hidden])) .bitcoin-pending-guidance { display: none; }
#verification-result:not(:has(#verified-height-row:not([hidden]))) .bitcoin-verified-guidance { display: none; }
#verification-result[data-source="current"] .file-match-state,
#verification-result[data-source="current"] .file-unchecked-state { display: none; }
.result-guidance {
  margin: .2rem 0 .9rem;
  color: var(--navy-soft);
  line-height: 1.5;
}
.verification-warning {
  margin: .8rem 0 0;
  padding: .75rem .85rem;
  border-radius: .7rem;
  background: #fff8e8;
  color: #73510c;
  line-height: 1.45;
}
.evidence-details {
  margin: .4rem 0 .7rem;
  padding: 0 .1rem;
}
.evidence-details div:first-child { border-top: 0; }
.result-technical-details { margin-top: .85rem; }
.technical-note { margin: .75rem 0 0; color: var(--muted); line-height: 1.45; font-size: .88rem; }
.claim-note {
  margin: .9rem 0 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.45;
}

.explanation {
  width: min(880px, calc(100% - 2rem));
  margin: 0 auto 3rem;
}
.explanation > h2 { max-width: 620px; margin-bottom: 1.35rem; }
.explanation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.explanation-grid article {
  padding: 1.15rem;
  border-top: 2px solid var(--line);
}
.explanation-grid h3 { margin: .45rem 0 .35rem; color: var(--navy); font-size: 1rem; }
.explanation-number { color: var(--green-dark); font-size: .78rem; font-weight: 850; letter-spacing: .08em; }
.limitation {
  margin-top: 1.35rem;
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--green);
  background: rgba(255,255,255,.55);
}
.limitation p { margin: .25rem 0 0; }
.independent-details {
  margin-top: 1rem;
  padding: .9rem 1.05rem;
  border: 1px solid rgba(7, 27, 44, .1);
  border-radius: .8rem;
  background: rgba(255,255,255,.55);
}
.independent-details p { margin: .65rem 0; }
.independent-details a { color: var(--green-dark); font-weight: 700; }

@media (max-width: 700px) {
  .site-header { padding: .85rem 1rem; }
  .site-footer { padding: 1rem; flex-direction: column; align-items: flex-start; }
  .hero { margin: 2.1rem auto 1.4rem; padding: 0 1rem; }
  .hero h1 { font-size: clamp(2.4rem, 11vw, 3.2rem); }
  .hero > p { font-size: .96rem; }
  .trust-list { gap: .45rem .8rem; font-size: .78rem; }
  .tool-shell { width: min(100% - 1rem, 880px); margin-bottom: 3rem; border-radius: 1rem; }
  .panel,
  .result-stage { padding: 1rem; }
  .stage-heading { display: block; }
  .stage-heading .badge { margin-top: .55rem; }
  .field input,
  .field textarea { font-size: 16px; }
  .actions { display: grid; grid-template-columns: 1fr; }
  .actions button { width: 100%; }
  .verification-check { grid-template-columns: 1.9rem minmax(0, 1fr); padding: .8rem; }
  .verification-check-icon { width: 1.8rem; height: 1.8rem; }
  .explanation { width: min(100% - 1.25rem, 880px); }
  .explanation-grid { grid-template-columns: 1fr; gap: .2rem; }
  .explanation-grid article { padding: .9rem .2rem; }
}
