/* 16ane explorer. Brand tokens shared with 16ane.net (site/public/styles.css); design in
   explorer/DESIGN.md. Every text pair is AA in both modes (ratios noted). */
:root {
  color-scheme: light dark;
  --ground: #f7f7fb;
  --raised: #ffffff;
  --rule: #e3e3ef;
  --rule-strong: #c9c9de;
  --ink: #1b194f;       /* 15.1:1 on ground */
  --muted: #5a5a80;     /* 6.1:1 on ground, 6.5:1 on raised */
  --link: #1b194f;
  --teal: #13b9ad;      /* marks only, never text on light */
  --credit: #0a6e67;    /* received, final: 6.1:1 on raised, 5.5:1 on its wash */
  --debit: #9c2b1f;     /* paid, failed: 7.6:1 on raised, 6.5:1 on its wash */
  --wash-credit: #e3f6f4;
  --wash-debit: #fbeae7;
  --slice-off: #dcdcec;
  --slice-on: #1b194f;
  --term-bg: #13123f;
  --term-ink: #eeeefa;
  --term-muted: #a5a8d8;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #13123f;
    --raised: #1c1b55;
    --rule: #2e2c6a;
    --rule-strong: #3d3b80;
    --ink: #eeeefa;     /* 14.1:1 on raised */
    --muted: #a5a8d8;   /* 6.9:1 on raised */
    --link: #c7c9f5;
    --credit: #13b9ad;  /* 6.4:1 on raised */
    --debit: #ff9d8f;   /* 7.8:1 on raised */
    --wash-credit: rgba(19, 185, 173, .14);
    --wash-debit: rgba(255, 157, 143, .12);
    --slice-off: #2e2c6a;
    --slice-on: #c7c9f5;
    --term-bg: #0c0b2b;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
:lang(hi) body, body:lang(hi) { line-height: 1.7; }   /* Devanagari needs more room */
a { color: var(--link); text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, input:focus-visible, pre:focus-visible, summary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -64px; padding: 10px 16px; background: var(--ink); color: var(--ground); border-radius: 8px; z-index: 5; }
.skip:focus { top: 8px; }
.mono, code { font-family: var(--mono); font-size: .9em; }
.num { font-variant-numeric: tabular-nums; }

/* Top bar */
.top { border-bottom: 1px solid var(--rule); background: var(--raised); }
.top-inner {
  max-width: 64rem; margin: 0 auto; padding: 12px 16px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px 20px; align-items: center;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.search { display: flex; min-width: 0; }
.search input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--rule-strong); border-right: 0; border-radius: 10px 0 0 10px;
  background: var(--ground); color: var(--ink); font: inherit; font-size: 15px;
}
.search button {
  min-height: 44px; padding: 0 16px; border: 1px solid var(--ink); border-radius: 0 10px 10px 0;
  background: var(--ink); color: var(--ground); font: 600 15px/1 var(--sans); cursor: pointer;
}
.lang { display: flex; border: 1px solid var(--rule-strong); border-radius: 10px; overflow: hidden; }
.lang button {
  min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--muted);
  font: 600 14px/1 var(--sans); cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.net { max-width: 64rem; margin: 0 auto; padding: 0 16px 10px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.net-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
@media (max-width: 640px) {
  .top-inner { grid-template-columns: 1fr auto; }
  .search { grid-column: 1 / -1; grid-row: 2; }
}

/* Page */
.page { max-width: 64rem; margin: 0 auto; padding: 28px 16px 56px; outline: none; }
.state { max-width: 40rem; margin: 48px 0; font-size: 18px; }
.state p { margin: 0 0 16px; }
.state .muted { color: var(--muted); font-size: 16px; }
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--raised);
  color: var(--ink); font: 600 15px/1 var(--sans); cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--teal); }

/* The receipt: one sheet, ruled sections */
.sheet { background: var(--raised); border: 1px solid var(--rule); border-radius: 16px; }
.sheet > section { padding: 24px; border-top: 1px solid var(--rule); }
.sheet > section:first-child { border-top: 0; }
@media (min-width: 720px) { .sheet > section { padding: 28px 32px; } }
.sheet h2 { margin: 0 0 16px; font-size: 20px; line-height: 1.3; letter-spacing: -.01em; }

.head { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: start; }
.kind { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; color: var(--muted); font-size: 15px; }
.status { padding: 2px 10px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.status--ok { background: var(--wash-credit); color: var(--credit); }
.status--fail { background: var(--wash-debit); color: var(--debit); }
.status--wait { background: var(--ground); color: var(--muted); }
.sentence {
  margin: 0; font-size: clamp(24px, 5.2vw, 38px); line-height: 1.2; letter-spacing: -.02em;
  font-weight: 650; text-wrap: balance; overflow-wrap: anywhere;
}
:lang(hi) .sentence { line-height: 1.4; letter-spacing: 0; }
.sentence a { color: inherit; text-decoration-thickness: 1px; text-decoration-color: var(--rule-strong); }
.sentence .amount { white-space: nowrap; }
.when { margin: 12px 0 0; color: var(--muted); }
.note { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

/* Finality disc: the 16ane mark. Slices fill toward finality; final shows the mark itself. */
.final { display: grid; justify-items: center; gap: 6px; min-width: 96px; text-align: center; }
.disc { width: 88px; height: 88px; overflow: visible; }
.disc .slices path {
  fill: var(--slice-off); stroke: var(--slice-off); stroke-width: 1.6; stroke-linejoin: round;
  transition: fill .4s, stroke .4s, transform .6s cubic-bezier(.2, .8, .2, 1);
}
.disc .slices path.on { fill: var(--slice-on); stroke: var(--slice-on); }
.disc.is-final .slices path { fill: var(--slice-on); stroke: var(--slice-on); }
.disc.is-final .slices path.s1 { fill: var(--teal); stroke: var(--teal); transform: translate(var(--dx), var(--dy)); }
/* begin hero-mark: generated by scripts/brand_assets.py */
.disc .s0 { --dx: 1.366px; --dy: -6.865px; }
.disc .s1 { --dx: 3.889px; --dy: -5.820px; }
.disc .s2 { --dx: 5.820px; --dy: -3.889px; }
.disc .s3 { --dx: 6.865px; --dy: -1.366px; }
.disc .s4 { --dx: 6.865px; --dy: 1.366px; }
.disc .s5 { --dx: 5.820px; --dy: 3.889px; }
.disc .s6 { --dx: 3.889px; --dy: 5.820px; }
.disc .s7 { --dx: 1.366px; --dy: 6.865px; }
.disc .s8 { --dx: -1.366px; --dy: 6.865px; }
.disc .s9 { --dx: -3.889px; --dy: 5.820px; }
.disc .s10 { --dx: -5.820px; --dy: 3.889px; }
.disc .s11 { --dx: -6.865px; --dy: 1.366px; }
.disc .s12 { --dx: -6.865px; --dy: -1.366px; }
.disc .s13 { --dx: -5.820px; --dy: -3.889px; }
.disc .s14 { --dx: -3.889px; --dy: -5.820px; }
.disc .s15 { --dx: -1.366px; --dy: -6.865px; }
/* end hero-mark */
.final-label { font-weight: 650; font-size: 15px; }
.final-label.is-final { color: var(--credit); }
.final-note { max-width: 12rem; font-size: 13px; color: var(--muted); line-height: 1.4; }
@media (max-width: 520px) {
  .head { grid-template-columns: 1fr; }
  .final { grid-template-columns: auto 1fr; justify-items: start; text-align: left; align-items: center; gap: 4px 14px; }
  .disc { width: 56px; height: 56px; grid-row: span 2; }
  .final-note { max-width: none; }
}

/* Ledger: who paid whom */
.ledger { width: 100%; border-collapse: collapse; }
.ledger th { text-align: left; font-weight: 600; font-size: 14px; color: var(--muted); padding: 0 0 10px; }
.ledger th.amt, .ledger td.amt { text-align: right; }
.ledger td { padding: 12px 0; border-top: 1px solid var(--rule); vertical-align: top; }
.ledger td + td, .ledger th + th { padding-left: 16px; }
.who { display: grid; gap: 2px; }
.who small { color: var(--muted); font-size: 13px; }
.amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.paid { color: var(--debit); }
.amt.recv { color: var(--credit); }
.coin { display: inline-flex; align-items: center; gap: 6px; }
.coin-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background: var(--rule-strong); }
.coin-dot.ane { background: conic-gradient(var(--teal) 0 22.5deg, var(--slice-on) 22.5deg 360deg); }
.tiny { display: block; font-size: 12px; color: var(--muted); white-space: normal; }
@media (max-width: 560px) {
  .ledger thead { display: none; }
  .ledger tr { display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--rule); padding: 10px 0; }
  .ledger td { border: 0; padding: 2px 0; }
  .ledger td + td { padding-left: 0; }
  .ledger td.amt { text-align: left; }
  .ledger td.amt:empty { display: none; }
  .ledger td.amt[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: 13px; }
}

/* Proof */
.facts { margin: 0; }
.facts > div { display: grid; grid-template-columns: 12rem 1fr; gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--rule); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .facts > div { grid-template-columns: 1fr; gap: 0; } }
.copy { margin-left: 8px; min-height: 32px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: 8px; background: transparent; color: var(--ink); font: 600 13px/1 var(--sans); cursor: pointer; vertical-align: middle; }

/* What ran */
.calls, .calls ul { list-style: none; margin: 0; padding: 0; }
.calls ul { margin-left: 18px; padding-left: 14px; border-left: 2px solid var(--rule); }
.calls li { padding: 8px 0; }
.call-line { display: block; }
.call-meta { display: block; font-size: 14px; color: var(--muted); }
.call-error { color: var(--debit); font-weight: 600; }
details.raw { margin-top: 16px; }
details.raw summary { cursor: pointer; color: var(--muted); min-height: 32px; }
pre.raw-body {
  margin: 8px 0 0; padding: 12px 14px; max-height: 18rem; overflow: auto; border-radius: 10px;
  background: var(--ground); border: 1px solid var(--rule); font: 13px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all;
}

/* For agents: always a dark terminal, like the brief on 16ane.net */
.agents { background: var(--term-bg); color: var(--term-ink); border-radius: 0 0 15px 15px; }
.agents h2 { color: var(--term-ink); }
.agents p { margin: 0 0 14px; color: var(--term-muted); font-size: 15px; }
.agents pre {
  margin: 0; padding: 14px; max-height: 20rem; overflow: auto; border-radius: 10px;
  border: 1px solid #2a2866; background: rgba(255, 255, 255, .03); color: var(--term-ink);
  font: 13px/1.55 var(--mono); white-space: pre-wrap; word-break: break-all;
}
.agents .copy { color: #13123f; background: #13b9ad; border-color: #13b9ad; margin: 0 0 12px; }

/* Home */
.home h1 { margin: 24px 0 8px; font-size: clamp(28px, 6vw, 44px); line-height: 1.15; letter-spacing: -.02em; }
.home > p { margin: 0 0 28px; color: var(--muted); font-size: 18px; max-width: 36rem; }
.examples { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; max-width: 40rem; }
.examples a { display: block; padding: 16px 18px; border: 1px solid var(--rule); border-radius: 12px; background: var(--raised); text-decoration: none; color: var(--ink); }
.examples a:hover { border-color: var(--teal); }
.examples small { display: block; color: var(--muted); font-family: var(--mono); font-size: 12px; margin-top: 4px; overflow-wrap: anywhere; }

.foot { max-width: 64rem; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 14px; }
.foot p { margin: 0 0 6px; }
.foot a { color: var(--muted); margin-right: 14px; }

@media (prefers-reduced-motion: reduce) { .disc .slices path { transition: none; } }

/* Short addresses inside sentences read in the text face; monospace stays for full hashes. */
.sentence a.mono, .call-line a.mono, .calls a.mono { font-family: inherit; font-size: inherit; }
.sentence a { white-space: nowrap; }
