/* Truvian Shield - single committed dark theme, matching the miner landing
   (bg #0a0a0a, text #e8e8e8, gold #caa53d, links #7db4ff, mono ui stack).
   Every color is painted explicitly; semantic colors are separate from the accent. */

:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --panel: #111111;
  --panel-2: #161616;
  --edge: #262626;
  --edge-soft: #1c1c1c;
  --text: #e8e8e8;
  --muted: #9a9a9a;
  --faint: #6f6f6f;
  --gold: #caa53d;
  --link: #7db4ff;
  --safe: #53c07f;
  --warn: #e0a84b;
  --block: #e05c5c;
  --neutral-chip: #8a8a8a;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
}

.page {
  /* 880px content plus three-quarters of the remaining viewport width, so
     only a small gap is left at each side (margins are 25% of a fixed-880px
     layout's) at every screen size; min(100%) prevents overflow on narrow
     viewports. */
  max-width: min(100%, calc(880px + 0.75 * (100vw - 880px)));
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---- header ---- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.header-left { flex: 1 1 300px; min-width: 0; }

/* Badges and the wallet button sit top-right, right-aligned. */
.header-right {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .6rem;
  text-align: right;
}

.site-header h1 {
  font-size: 1.65rem;
  margin: 0 0 .25rem;
  letter-spacing: -.01em;
  text-wrap: balance;
}

/* ---- brand lockup (header + footer) ---- */

.brand { margin: 0 0 .85rem; line-height: 0; }
.brand a { display: inline-block; line-height: 0; }
.brand-logo { display: block; height: 52px; width: auto; max-width: 100%; }

.tagline {
  color: var(--muted);
  margin: 0;
  max-width: 42ch;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem .75rem;
  font-size: .8rem;
}

.wallet-state { max-width: 34ch; }

.badge {
  display: inline-block;
  border: 1px solid var(--gold);
  color: var(--gold);
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .75rem;
  white-space: nowrap;
}

.sep { color: var(--faint); }

/* ---- wallet bar ---- */

.wallet-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem .75rem;
}

.wallet-btn {
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: .35rem .75rem;
  cursor: pointer;
}

.wallet-btn:hover:not(:disabled) { background: rgba(202, 165, 61, .12); }
.wallet-btn:disabled { opacity: .6; cursor: wait; }
.wallet-btn.connected { color: var(--safe); border-color: var(--safe); }
.wallet-btn.connected:hover { background: rgba(83, 192, 127, .12); cursor: default; }

.wallet-state { font-size: .78rem; color: var(--faint); }

/* ---- payment notice ---- */

.pay-notice {
  margin: 0;
  font-size: .82rem;
  color: var(--gold);
  border-left: 3px solid var(--gold);
  padding-left: .75rem;
  word-break: break-all;
}

/* ---- live stats strip ---- */

.stats-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .6rem;
  margin: 1.75rem 0 0;
  padding: .55rem .85rem;
  border-top: 1px solid var(--edge-soft);
  border-bottom: 1px solid var(--edge-soft);
  font-size: .8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stats-dot { color: var(--gold); font-size: .6rem; }

.stats-detail { color: var(--faint); }

/* ---- sections ---- */

.section-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 .75rem;
}

.check-section,
.how-section { margin-top: 2.5rem; }

.section-note {
  color: var(--muted);
  font-size: .875rem;
  max-width: 64ch;
  margin: 0 0 1.5rem;
}

/* ---- one-click examples ---- */

.presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
  margin: 0 0 1.5rem;
}

.presets-label { font-size: .78rem; color: var(--muted); }
.presets-note { font-size: .74rem; color: var(--faint); }

.preset-btn {
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: .35rem .7rem;
  cursor: pointer;
  color: var(--text);
}

.preset-btn:hover { border-color: currentColor; }
.preset-safe { color: var(--safe); }
.preset-block { color: var(--block); }

/* ---- form ---- */

#check-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

.field { display: flex; flex-direction: column; gap: .35rem; }
.wide { grid-column: 1 / -1; }

.field label {
  font-size: .78rem;
  color: var(--muted);
  letter-spacing: .02em;
}

.label-hint { color: var(--faint); }

.field input,
.field select {
  font: inherit;
  font-size: .875rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: .55rem .7rem;
  width: 100%;
}

.field input::placeholder { color: var(--faint); }

.field input:focus,
.field select:focus { border-color: var(--gold); }

.submit-field { justify-content: flex-end; }

#submit-btn {
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: .6rem 1rem;
  cursor: pointer;
}

#submit-btn:hover:not(:disabled) { filter: brightness(1.1); }

#submit-btn:disabled {
  background: var(--panel-2);
  border-color: var(--edge);
  color: var(--muted);
  cursor: wait;
}

.form-error {
  margin: 0;
  font-size: .85rem;
  color: var(--block);
  border-left: 3px solid var(--block);
  padding-left: .75rem;
}

/* ---- report ---- */

.report { margin-top: 2.5rem; }

.verdict {
  border: 1px solid var(--edge);
  border-left-width: 4px;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 1rem;
  background: var(--panel);
}

.verdict:empty { display: none; }

.verdict .verdict-word {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.verdict .verdict-score {
  color: var(--muted);
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}

.verdict.safe    { border-left-color: var(--safe);  background: rgba(83, 192, 127, .07); }
.verdict.caution { border-left-color: var(--warn);  background: rgba(224, 168, 75, .07); }
.verdict.block   { border-left-color: var(--block); background: rgba(224, 92, 92, .07); }
.verdict.safe .verdict-word    { color: var(--safe); }
.verdict.caution .verdict-word { color: var(--warn); }
.verdict.block .verdict-word   { color: var(--block); }

.reasons {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  color: var(--muted);
  font-size: .875rem;
}

.reasons:empty { display: none; }

.reasons li { margin: .35rem 0; padding-left: 1.1rem; position: relative; }
.reasons li::before { content: "»"; position: absolute; left: 0; color: var(--faint); }

#evidence-heading { margin-top: 2rem; }
#evidence-heading:empty { display: none; }

/* ---- check cards ---- */

.checks { display: flex; flex-direction: column; gap: 1rem; }

.check-card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: .9rem 1.1rem;
}

.check-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .75rem;
}

.check-name { font-weight: 600; font-size: .95rem; }

.intent-tag {
  font-size: .68rem;
  letter-spacing: .1em;
  color: var(--faint);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: .05rem .4rem;
  white-space: nowrap;
}

.status-chip {
  margin-left: auto;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: .1rem .5rem;
  border: 1px solid;
  white-space: nowrap;
}

.status-chip.pass  { color: var(--safe);         border-color: var(--safe);         background: rgba(83, 192, 127, .1); }
.status-chip.warn  { color: var(--warn);         border-color: var(--warn);         background: rgba(224, 168, 75, .1); }
.status-chip.fail  { color: var(--block);        border-color: var(--block);        background: rgba(224, 92, 92, .1); }
.status-chip.error { color: var(--neutral-chip); border-color: var(--neutral-chip); background: rgba(138, 138, 138, .1); }
.status-chip.pending { color: var(--faint); border-color: var(--edge); background: transparent; }
.status-chip.answered { color: var(--gold); border-color: var(--gold); background: rgba(202, 165, 61, .1); }

/* A row that is still waiting on its miner pulses gently. */
.check-card.live .status-chip.pending { animation: chip-pulse 1.2s ease-in-out infinite; }
@keyframes chip-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .check-card.live .status-chip.pending { animation: none; } }

.check-summary {
  margin: .5rem 0 0;
  font-size: .875rem;
  color: var(--muted);
}

.check-answer {
  margin: .6rem 0 0;
  padding: .6rem .8rem;
  background: var(--panel-2);
  border: 1px solid var(--edge-soft);
  border-left: 3px solid var(--edge);
  border-radius: 4px;
  font-size: .85rem;
  color: var(--text);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.check-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .9rem;
  margin-top: .65rem;
  font-size: .75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.transport-chip {
  font-size: .68rem;
  letter-spacing: .06em;
  border: 1px solid;
  border-radius: 4px;
  padding: .05rem .45rem;
  white-space: nowrap;
}

.transport-chip.x402   { color: var(--gold);  border-color: var(--gold); }
.transport-chip.direct { color: var(--muted); border-color: var(--edge); }

.signal-link { font-size: .75rem; word-break: break-all; }

.verify-btn {
  font: inherit;
  font-size: .7rem;
  letter-spacing: .04em;
  color: var(--gold);
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: .05rem .45rem;
  cursor: pointer;
}

.verify-btn:hover:not(:disabled) { background: rgba(202, 165, 61, .12); }
.verify-btn:disabled { opacity: .75; cursor: default; }

.verify-result { font-size: .72rem; word-break: break-word; }
.verify-result.ok { color: var(--safe); }
.verify-result.bad { color: var(--warn); }

/* ---- receipt permalink ---- */

.receipt-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .75rem;
  margin-top: .85rem;
  font-size: .78rem;
  color: var(--muted);
}

.receipt-bar input {
  font: inherit;
  font-size: .75rem;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: .25rem .5rem;
  min-width: 22ch;
  flex: 1 1 22ch;
}

.copy-btn {
  font: inherit;
  font-size: .72rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: .2rem .55rem;
  cursor: pointer;
}

.copy-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ---- how it works ---- */

.how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

.how-item {
  border: 1px solid var(--edge-soft);
  border-radius: 4px;
  padding: .9rem 1.1rem;
  background: var(--panel);
}

.how-item h3 { margin: .5rem 0 .25rem; font-size: .95rem; }

.how-item p { margin: 0; font-size: .82rem; color: var(--muted); }

.how-footnote {
  color: var(--faint);
  font-size: .8rem;
  max-width: 64ch;
  margin: 1.25rem 0 0;
}

/* ---- footer ---- */

.site-footer {
  margin-top: 4rem;
  padding: 3rem 0 1.75rem;
  border-top: 1px solid var(--edge-soft);
  color: var(--muted);
  font-size: .82rem;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: 2rem 2.5rem;
}

.foot-brand { display: inline-block; line-height: 0; margin: 0 0 1rem; }
.foot-logo { display: block; height: 38px; width: auto; opacity: .9; }

.foot-desc {
  margin: 0 0 1.25rem;
  max-width: 40ch;
  line-height: 1.65;
}

.foot-social { display: flex; gap: 1rem; }
.foot-social a { color: var(--muted); line-height: 0; }
.foot-social a:hover { color: var(--text); }
.foot-social svg { width: 22px; height: 22px; fill: currentColor; }

.foot-col h4 {
  margin: 0 0 1.1rem;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--faint);
}

.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin: 0 0 .75rem; }
.foot-col a { color: var(--muted); }
.foot-col a:hover { color: var(--text); text-decoration: none; }

@media (max-width: 860px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand-col { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; }
}

/* ---- responsive ---- */

@media (max-width: 700px) {
  .page { padding: 1.75rem 1rem 2.5rem; }
  .brand-logo { height: 42px; }
  .header-right { align-items: flex-start; text-align: left; }
  .badge-row, .wallet-bar { justify-content: flex-start; }
  #check-form { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: 1fr; }
  .status-chip { margin-left: 0; }
}

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