:root {
  --paper: #fbfbf9;
  --surface: #ffffff;
  --ink: #101418;
  --ink-muted: #5b6470;
  --faint: #68707c;
  --line: #e7e7e2;
  --line-strong: #d6d6ce;
  --accent: #1f4be0;
  --accent-ink: #12329b;
  --accent-wash: #eef2fe;
  --success: #0f7a4d;
  --success-wash: #ecf6f1;
  --danger: #b4231f;
  --amber: #b45309;
  --amber-wash: #fbf3e8;
  --code: #1b2733;
  --radius: 12px;
  --radius-sm: 8px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow-sm: 0 1px 2px rgba(16, 20, 24, 0.05);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { font-family: "Space Grotesk", "Inter", sans-serif; }
strong { color: var(--ink); font-weight: 600; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Faint engraved grid, a ledger paper cue */
.aura {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 88px 88px;
  background-position: center -1px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(135vw 90vh at 50% -20%, #000, transparent 66%);
  mask-image: radial-gradient(135vw 90vh at 50% -20%, #000, transparent 66%);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: rgba(251, 251, 249, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.logo { width: 39px; height: 39px; }
.wordmark { font-family: "Space Grotesk", "Inter", sans-serif; font-size: 21px; font-weight: 700; letter-spacing: -0.045em; }
.wordmark .accent { color: var(--accent); }

.wallet { display: flex; align-items: center; gap: 11px; }
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--faint);
  box-shadow: 0 0 0 3px rgba(16, 20, 24, 0.05);
  transition: background 0.2s, box-shadow 0.2s;
}
.dot.ok { background: var(--success); box-shadow: 0 0 0 3px rgba(15, 122, 77, 0.14); }
.dot.warn { background: var(--amber); box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.14); }

/* Buttons */
.btn {
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.btn:hover { border-color: var(--ink-muted); background: #f6f6f3; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: #f2f2ee; }
.btn.small { padding: 7px 13px; font-size: 13px; }
.btn.primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn.primary:hover:not(:disabled) { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.block {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding: 13px;
  font-size: 15px;
}

/* Layout */
main { max-width: 760px; margin: 0 auto; padding: 6px 22px 60px; }

.hero { text-align: left; padding: 54px 0 30px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-muted);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.live {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

.hero h1 {
  font-size: clamp(32px, 5.6vw, 50px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ink);
}
.grad { color: var(--accent); }
.lede { max-width: 560px; margin: 0; color: var(--ink-muted); font-size: 16px; }

/* Tabs, underline nav */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin: 0 0 26px;
}
.tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-muted);
  font-family: "Inter", sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  padding: 11px 16px;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }

/* Panels */
.panel { display: none; }
.panel.active {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.panel-head h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.panel-head svg { color: var(--accent); flex-shrink: 0; }

.muted { color: var(--ink-muted); font-size: 14px; margin-top: 0; }

/* Dropzone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: 10px;
  padding: 34px 20px;
  margin: 16px 0;
  cursor: pointer;
  background: var(--paper);
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-wash); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-wash); }
.dz-icon { color: var(--accent); margin-bottom: 4px; }
.dz-title { margin: 0; font-weight: 600; font-size: 15px; }
.dz-sub { margin: 0; color: var(--ink-muted); font-size: 13px; }
.link { color: var(--accent-ink); font-weight: 500; }
.dropzone:hover .link { text-decoration: underline; }

/* File info */
.fileinfo {
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0;
  font-size: 13.5px;
}
.fileinfo .row { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.fileinfo .label { color: var(--ink-muted); flex-shrink: 0; }
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  font-size: 12.5px;
  color: var(--code);
}
.hidden { display: none !important; }

/* Or divider */
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.or::before, .or::after { content: ""; height: 1px; flex: 1; background: var(--line); }

/* Inputs */
.hashrow { display: flex; gap: 8px; }
.hashrow input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--ink);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.hashrow input::placeholder { color: var(--faint); font-family: "Inter", sans-serif; }
.hashrow input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.keyrow { margin-top: 4px; }
.keyhint { margin: 9px 0 16px; font-size: 12px; color: var(--ink-muted); }

/* Status */
.status { margin-top: 14px; font-size: 13.5px; min-height: 1.2em; color: var(--ink-muted); }
.status.ok { color: var(--success); }
.status.bad { color: var(--danger); }
.spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(16, 20, 24, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Result card */
.result { margin-top: 16px; }
.result .card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 14px;
}
.result .card.found { border-left-color: var(--success); background: var(--success-wash); }
.result .card.notfound { border-left-color: var(--amber); background: var(--amber-wash); }
.result .card .row { display: flex; justify-content: space-between; gap: 14px; }
.result .card .label { color: var(--ink-muted); flex-shrink: 0; }

/* Lists */
.subhead { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; }
.subhead h3 { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.subhead .muted { font-weight: 400; font-size: 13px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  font-size: 13px;
  transition: border-color 0.18s, background 0.18s;
}
.item:hover { border-color: var(--line-strong); background: var(--paper); }
.item .top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.item .name { font-weight: 600; font-size: 14px; color: var(--ink); }
.item .hash { color: var(--accent-ink); font-family: var(--mono); font-weight: 500; }
.item .time { color: var(--ink-muted); white-space: nowrap; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.item .meta { color: var(--ink-muted); margin-top: 5px; }
.item .meta .mono { color: var(--faint); }

.empty {
  color: var(--ink-muted);
  font-size: 13.5px;
  padding: 16px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--paper);
}

/* Footer */
footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 22px 54px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink-muted);
  font-size: 13px;
}
.foot-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.logo-sm { width: 22px; height: 22px; }
.footer-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
}
.foot-label { color: var(--faint); }
.footer-text a { color: var(--accent-ink); }
#contractLink { font-family: var(--mono); font-size: 12px; word-break: break-all; }

/* Legal pages */
.legal { padding-top: 34px; }
.legal .eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 10px;
}
.legal h1 {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: clamp(28px, 4.4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
}
.legal .updated { color: var(--faint); font-size: 13px; margin: 0 0 30px; }
.legal h2 {
  font-size: 18px;
  letter-spacing: -0.015em;
  margin: 34px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.legal h2:first-of-type { border-top: none; padding-top: 0; }
.legal p, .legal li { color: var(--ink-muted); font-size: 15px; }
.legal p { margin: 0 0 14px; }
.legal ul { margin: 0 0 14px; padding-left: 20px; }
.legal li { margin: 0 0 7px; }
.legal .lead { color: var(--ink); font-size: 16px; }
.legal a { color: var(--accent-ink); }
.legal .backlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  margin-top: 40px;
  color: var(--ink-muted);
}
.legal code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--accent-wash);
  color: var(--accent-ink);
  padding: 1px 6px;
  border-radius: 5px;
  word-break: break-all;
}

/* Flourishes */
::selection { background: rgba(31, 75, 224, 0.16); color: var(--ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid var(--paper); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #c2c2b9; background-clip: padding-box; }

@media (max-width: 560px) {
  .topbar { padding: 13px 16px; }
  main { padding: 6px 16px 50px; }
  .hero { padding: 36px 0 24px; }
  .panel.active { padding: 20px 16px; }
  .wordmark { font-size: 17px; }
  footer { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer-text { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
