/* PermaData — v2. Dark, typographic, one accent. System fonts only. */

:root {
  --bg: #0b0c0f;
  --bg-elev: #111318;
  --bg-code: #0f1114;
  --fg: #e9eaee;
  --muted: #9aa1ac;
  --dim: #6b727d;
  --accent: #53dcf4;
  --accent-ink: #0b0c0f;
  --border: #23262d;
  --border-strong: #2e323b;
  --radius: 6px;
  --maxw: 880px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.mono, code { font-family: var(--mono); }
code.inline {
  font-size: 13px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--fg);
}

/* ── header ─────────────────────────────────────────────── */
.site-head { border-bottom: 1px solid var(--border); padding: 20px 0; }
.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.wordmark {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
}
.wordmark:hover { text-decoration: none; }
.wordmark .accent { color: var(--accent); }
.site-head .nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: center;
  margin-left: auto;
}
.site-head .nav a {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 10px 2px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
}
.site-head .nav a:hover { color: var(--fg); text-decoration: none; }
.site-head .nav a[aria-current="page"] { color: var(--fg); }
.site-head .tag { color: var(--dim); font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; white-space: nowrap; }

/* ── hero ───────────────────────────────────────────────── */
.hero { padding: 68px 0 40px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 20px;
}
.hero h1 {
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  font-weight: 800;
}
.lede {
  font-size: clamp(17px, 2.5vw, 21px);
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
  max-width: 42em;
  font-weight: 400;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; align-items: center; }
.cta-trade { color: var(--dim); font-size: 14px; margin: 16px 0 0; max-width: 48em; }

/* ── buttons ────────────────────────────────────────────── */
.dl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  padding: 14px 22px;
  min-height: 46px;
  border-radius: var(--radius);
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.dl-btn:hover { text-decoration: none; filter: brightness(1.06); }
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 20px;
  min-height: 46px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.ghost-btn:hover { text-decoration: none; color: var(--fg); border-color: var(--accent); }
button:disabled, .dl-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* ── sections ───────────────────────────────────────────── */
section.block { padding: 56px 0 4px; }
h2 {
  font-size: clamp(21px, 3vw, 27px);
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  font-weight: 750;
}
h2 .num { color: var(--accent); font-family: var(--mono); font-size: 0.72em; margin-right: 10px; }
.sub { color: var(--muted); margin: 0 0 26px; max-width: 48em; }
h3 { font-size: 16px; margin: 0 0 8px; font-weight: 650; }

/* ── stamp card ─────────────────────────────────────────── */
.stamp-card {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 24px;
}
.stamp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.stamp-title { font-size: 17px; font-weight: 700; }
.stamp-title .year { color: var(--dim); font-weight: 500; }
.stamp-status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}

.specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 22px;
}
.spec { background: var(--bg); padding: 16px 16px; min-width: 0; }
.spec .k {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 6px;
}
.spec .v { font-family: var(--mono); font-size: 13.5px; color: var(--fg); word-break: break-word; }

/* ── copy rows / code ───────────────────────────────────── */
.code-block, .copy-row {
  display: flex;
  align-items: stretch;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.copy-row { margin: 10px 0; }
.copy-row code, .code-block code {
  flex: 1;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.55;
  padding: 14px 16px;
  color: var(--fg);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.copy-btn {
  flex-shrink: 0;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 0 18px;
  min-height: 44px;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.copy-btn:hover { color: var(--fg); background: var(--border-strong); }
.copy-btn.copied { color: var(--accent-ink); background: var(--accent); }
.copy-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); display: block; margin: 20px 0 4px; }
.label:first-child { margin-top: 0; }
.hash-value { font-size: 15px; }
.hint { color: var(--dim); font-size: 13.5px; margin: 6px 0 0; }

/* ── steps ──────────────────────────────────────────────── */
.step { display: flex; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.step:last-of-type { border-bottom: 0; }
.step .n {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 14px; color: var(--accent);
}
.step .body { flex: 1; min-width: 0; }
.step p { margin: 0; color: var(--muted); }
.step p strong { color: var(--fg); }

/* ── tables ─────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 480px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-weight: 600; background: var(--bg-code); }
tr:last-child td { border-bottom: 0; }
td.mono, td code { font-family: var(--mono); font-size: 13px; }
td .status { font-family: var(--mono); font-size: 12px; }
td .status.ok { color: var(--accent); }
td .status.na { color: var(--dim); }
.notes { list-style: none; padding: 0; margin: 18px 0 0; }
.notes li { position: relative; padding-left: 20px; margin: 8px 0; color: var(--muted); font-size: 14.5px; }
.notes li::before { content: "—"; position: absolute; left: 0; color: var(--dim); }

/* ── protocol facts ─────────────────────────────────────── */
.facts { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fact { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.fact:last-child { border-bottom: 0; }
.fact .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); flex-shrink: 0; padding-top: 2px; }
.fact .v { font-family: var(--mono); font-size: 13.5px; color: var(--fg); word-break: break-all; text-align: right; }
.fact .v:not(.mono) { font-family: var(--sans); }

/* ── two-tier cards ─────────────────────────────────────── */
.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tier-card {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.tier-card.live { border-color: var(--accent); }
.tier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.tier-title { font-size: 17px; font-weight: 700; font-family: var(--mono); letter-spacing: 0.02em; }
.tier-title .sub-t { display: block; font-family: var(--sans); font-weight: 500; font-size: 13px; color: var(--dim); margin-top: 2px; }
.badge {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 3px 8px;
  white-space: nowrap;
}
.badge.live { color: var(--accent); }
.badge.ship { color: var(--muted); }
.tier-card p { color: var(--muted); margin: 0 0 12px; }
.tier-card p:last-child { margin-bottom: 0; }
.tier-card p strong { color: var(--fg); }
.tier-list { list-style: none; padding: 0; margin: 0 0 14px; }
.tier-list li {
  position: relative;
  padding-left: 20px;
  margin: 7px 0;
  color: var(--muted);
  font-size: 14.5px;
}
.tier-list li::before { content: "—"; position: absolute; left: 0; color: var(--dim); }
.tier-price { margin-top: auto; border-top: 1px solid var(--border); padding-top: 14px; }
.tier-price .big { font-family: var(--mono); font-size: 22px; color: var(--fg); font-weight: 700; display: block; }
.tier-price .small { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.tier-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 14px; font-family: var(--mono); font-size: 12.5px; color: var(--dim); }

/* ── callout ────────────────────────────────────────────── */
.callout {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-elev);
  padding: 20px 24px;
  margin: 0 0 16px;
}
.callout p { margin: 0 0 12px; color: var(--muted); }
.callout p:last-child { margin-bottom: 0; }
.callout p strong { color: var(--fg); }
.callout .big { font-size: 18px; color: var(--fg); font-weight: 700; }

/* ── live stats ─────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 18px 16px;
}
.stat .k { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.stat .v { font-family: var(--mono); font-size: 20px; color: var(--fg); font-weight: 700; word-break: break-word; }
.stat .v.small { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat .sub { font-family: var(--mono); font-size: 11px; color: var(--dim); margin: 4px 0 0; }
.loading { color: var(--dim); font-family: var(--mono); font-size: 13px; }

/* ── wallet (injected, minimal) ─────────────────────────── */
.wallet-wrap { position: relative; display: inline-block; }
.wallet-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px 18px;
  min-height: 46px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--fg);
  cursor: pointer;
}
.wallet-btn:hover { border-color: var(--accent); }
.wallet-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.wallet-btn.on .dot { background: var(--accent); }
.wallet-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  z-index: 20;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.wallet-panel .wh { font-family: var(--mono); font-size: 12px; color: var(--dim); padding: 12px 14px; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.1em; }
.wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  padding: 13px 14px;
  min-height: 46px;
  cursor: pointer;
}
.wallet-row:last-of-type { border-bottom: 0; }
.wallet-row:hover { background: var(--bg-code); }
.wallet-row.sel { background: var(--bg-code); }
.wallet-row .nm { font-weight: 600; }
.wallet-row .st { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.wallet-row .st.ok { color: var(--accent); }
.wallet-foot { font-family: var(--mono); font-size: 11px; color: var(--dim); padding: 11px 14px; border-top: 1px solid var(--border); }
.wallet-foot.err { color: #f0a27a; }

/* ── upload page ────────────────────────────────────────── */
.dropzone {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-code);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--bg-elev); }
.dropzone .strong { color: var(--fg); font-weight: 600; }
.dropzone .mono { font-family: var(--mono); font-size: 13px; color: var(--dim); }
.dropzone input { display: none; }

.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}
.file-row .ficon { font-size: 24px; flex-shrink: 0; }
.file-row .finfo { flex: 1; min-width: 0; }
.file-row .fname { font-weight: 600; word-break: break-all; }
.file-row .fmeta { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.file-row .fremove {
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 12px;
  min-height: 44px;
  cursor: pointer;
}
.file-row .fremove:hover { color: var(--fg); border-color: var(--accent); }

.tier-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tier-option {
  position: relative;
  display: block;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  text-align: left;
  color: var(--fg);
}
.tier-option input { position: absolute; opacity: 0; pointer-events: none; }
.tier-option .to-title { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.tier-option .to-desc { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.tier-option .to-avail { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 8px; display: inline-block; }
.tier-option .to-avail.live { color: var(--accent); }
.tier-option .to-avail.ship { color: var(--dim); }
.tier-option.selected { border-color: var(--accent); }
.tier-option[data-disabled="true"] { cursor: default; opacity: 0.9; }

.cost-box {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 18px;
}
.cost-line { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cost-line:last-child { border-bottom: 0; }
.cost-line .ck { color: var(--muted); font-size: 14px; }
.cost-line .cv { font-family: var(--mono); font-size: 14px; color: var(--fg); text-align: right; }
.cost-line.total .ck { color: var(--fg); font-weight: 700; }
.cost-line.total .cv { color: var(--accent); font-size: 18px; font-weight: 700; }
.cost-note { color: var(--dim); font-size: 13px; margin-top: 12px; }

.field { display: block; width: 100%; background: var(--bg-code); border: 1px solid var(--border-strong); border-radius: var(--radius); color: var(--fg); font-family: var(--mono); font-size: 14px; padding: 13px 14px; min-height: 46px; }
.field::placeholder { color: var(--dim); }
.field:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* ── stamp page ─────────────────────────────────────────── */
.meta-grid { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.meta-grid .fact { border-bottom: 1px solid var(--border); }
.meta-grid .fact:last-child { border-bottom: 0; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 3px 9px;
  color: var(--muted);
  margin: 0 6px 6px 0;
}
.pill.on { color: var(--accent); border-color: var(--accent); }

/* ── files list ─────────────────────────────────────────── */
.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  text-decoration: none;
  color: var(--fg);
}
.file-item:hover { border-color: var(--accent); text-decoration: none; }
.file-item .ficon { font-size: 22px; flex-shrink: 0; }
.file-item .finfo { flex: 1; min-width: 0; }
.file-item .fname { font-weight: 600; word-break: break-all; }
.file-item .fmeta { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.file-item .farrow { color: var(--dim); flex-shrink: 0; font-family: var(--mono); }
.empty { color: var(--muted); padding: 24px 0; }

/* ── toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  background: var(--fg);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 13px;
  padding: 12px 18px;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 50;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── warn ───────────────────────────────────────────────── */
.warn { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 14px 16px; font-size: 14px; color: var(--muted); background: var(--bg-elev); }
.warn-amber { border-left: 3px solid #f0b27a; }

/* ── end CTA ────────────────────────────────────────────── */
.cta-end { padding-bottom: 32px; }

/* ── footer ─────────────────────────────────────────────── */
footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 40px 0 64px; color: var(--dim); }
footer .mono { font-family: var(--mono); font-size: 13px; }
footer .row { margin: 8px 0; }
footer .row a { color: var(--muted); }
footer .row a:hover { color: var(--fg); }

/* ── responsive ─────────────────────────────────────────── */
@media (max-width: 720px) {
  .site-head .nav { order: 3; width: 100%; margin-left: 0; gap: 4px 14px; }
  .site-head .nav a { padding: 8px 2px; min-height: 44px; }
  .site-head .tag { display: none; }
  .hero { padding: 48px 0 36px; }
  section.block { padding: 44px 0 4px; }
  .tiers, .tier-pick { grid-template-columns: 1fr; }
  .specs { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .fact { flex-direction: column; gap: 4px; }
  .fact .v { text-align: left; }
  .step { gap: 14px; }
}
@media (max-width: 420px) {
  .specs { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .wallet-panel { width: 240px; }
}
