/* Auspex. Night instrument: ink ground, bone type, one ice accent reserved for
   non-stock tokens and the active state. Sharp corners like a printed star chart. */
:root {
  --ink: #0a0a0c;
  --ink-2: #121216;
  --line: #2a2a30;
  --bone: #ece7dc;
  --dim: #a09a8f;      /* 7.1:1 on --ink */
  --ice: #8ee6ff;      /* accent */
  --f-display: "Funnel Display", "Funnel Sans", system-ui, sans-serif;
  --f-body: "Funnel Sans", system-ui, sans-serif;
  --f-mono: "Fragment Mono", ui-monospace, Menlo, monospace;
  --pad: clamp(1.1rem, 4vw, 3.5rem);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--ink); color: var(--bone);
  font: 400 1rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ice); }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
code, pre { font-family: var(--f-mono); font-size: .86em; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); line-height: 1.1; }
h3 { font-size: 1.05rem; font-weight: 600; letter-spacing: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }

.skip { position: absolute; left: -999px; top: 0; background: var(--bone); color: var(--ink); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; top: 1rem; }

/* Boot: shows the real first data load, then gets out of the way. */
.boot { position: fixed; inset: 0; z-index: 40; background: var(--ink); display: grid; place-items: center; padding: var(--pad); transition: opacity .4s ease; }
.boot.out { opacity: 0; pointer-events: none; }
.boot[hidden], .sky-tip[hidden] { display: none; }
.boot-in { width: min(36rem, 100%); }
.boot-mark { font: 800 1.1rem/1 var(--f-display); letter-spacing: .32em; margin-bottom: 1.4rem; }
.boot-lines { list-style: none; margin: 0 0 1.4rem; padding: 0; font: .82rem/1.9 var(--f-mono); color: var(--dim); }
.boot-lines li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); }
.boot-lines li b { font-weight: 400; color: var(--ice); white-space: nowrap; }
.boot-lines li.bad b { color: var(--bone); }
.boot-skip { background: none; border: 0; padding: .3rem 0; font: .8rem var(--f-mono); color: var(--dim); text-decoration: underline; }
.boot-skip:hover { color: var(--bone); }

/* Header */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .85rem var(--pad);
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}
.mark { font: 800 1rem/1 var(--f-display); letter-spacing: .3em; text-decoration: none; }
.nav { display: flex; gap: 1.3rem; margin-left: auto; font-size: .92rem; }
.nav a { text-decoration: none; color: var(--dim); padding: .35rem 0; }
.nav a:hover { color: var(--bone); }
.top-x { font: .82rem var(--f-mono); text-decoration: none; border: 1px solid var(--line); padding: .45rem .7rem; }
.top-x:hover { border-color: var(--ice); }
@media (max-width: 860px) {
  .nav { display: none; }
  .top-x { margin-left: auto; }
}

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 4vw, 4rem); align-items: center;
  padding: clamp(2.5rem, 7vw, 6rem) var(--pad) clamp(2rem, 4vw, 3rem);
}
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.7rem); font-weight: 800; line-height: .96; letter-spacing: -0.035em; }
.lede { margin-top: 1.6rem; max-width: 34rem; font-size: clamp(1.02rem, 1.4vw, 1.15rem); color: var(--dim); }
.motto { margin-top: 1.1rem; font: .9rem var(--f-mono); color: var(--bone); }
.hero-act { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.btn { display: inline-flex; align-items: center; min-height: 2.9rem; padding: 0 1.25rem; font-weight: 500; font-size: .95rem; text-decoration: none; border: 1px solid var(--bone); border-radius: 2px; transition: background .15s, color .15s, border-color .15s; }
.btn-solid { background: var(--bone); color: var(--ink); }
.btn-solid:hover { background: var(--ice); border-color: var(--ice); color: var(--ink); }
.btn-solid:active { transform: translateY(1px); }
.btn-line { background: transparent; }
.btn-line:hover { border-color: var(--ice); color: var(--ice); }
.link-btn { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; color: var(--bone); }
.link-btn:hover { color: var(--ice); }

.templum { margin: 0; }
.templum-stage { position: relative; aspect-ratio: 1; width: min(100%, 38rem); margin-inline: auto; }
.templum canvas { width: 100%; height: 100%; display: block; }
.q { position: absolute; font: .72rem/1.2 var(--f-mono); color: var(--dim); pointer-events: none; }
.q em { font-style: normal; color: var(--bone); opacity: .7; }
.q-nw { top: 2%; left: 0; } .q-ne { top: 2%; right: 0; text-align: right; }
.q-sw { bottom: 2%; left: 0; } .q-se { bottom: 2%; right: 0; text-align: right; }
.sky-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: var(--bone); color: var(--ink); font: .76rem/1.4 var(--f-mono); padding: .35rem .55rem; white-space: nowrap; pointer-events: none; }
.templum figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin: 1rem auto 0; width: min(100%, 38rem); font-size: .82rem; color: var(--dim); }
.templum figcaption .link-btn { white-space: nowrap; font-size: .82rem; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
}

/* Ledger: the four live numbers */
.ledger { padding: 0 var(--pad); }
.ledger-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ledger-row > div { padding: 1.2rem 1rem 1.3rem 0; }
.ledger-row > div + div { padding-left: 1.2rem; border-left: 1px solid var(--line); }
.ledger dt { font-size: .8rem; color: var(--dim); }
.ledger dd { margin: .35rem 0 0; font: 600 clamp(1.5rem, 3vw, 2.3rem)/1 var(--f-display); font-variant-numeric: tabular-nums; }
.ledger dd[data-k="poll"] { font: 400 .95rem/1.4 var(--f-mono); padding-top: .4rem; }
@media (max-width: 700px) {
  .ledger-row { grid-template-columns: 1fr 1fr; }
  .ledger-row > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .ledger-row > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* Signs feed */
.signs { padding: clamp(3.5rem, 8vw, 6.5rem) var(--pad) 2rem; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem 2rem; margin-bottom: 1.8rem; }
.seg { display: flex; border: 1px solid var(--line); }
.seg button { background: none; border: 0; padding: .55rem .9rem; font-size: .88rem; color: var(--dim); min-height: 2.6rem; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--bone); }
.seg button[aria-pressed="true"] { background: var(--bone); color: var(--ink); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 11.5rem 8.5rem 8rem minmax(0, 1fr) auto; gap: 1rem; align-items: baseline; padding: .85rem 0; border-top: 1px solid var(--line); }
.feed li:last-child { border-bottom: 1px solid var(--line); }
.f-at { font: .8rem var(--f-mono); color: var(--dim); }
.f-kind { font-size: .82rem; color: var(--dim); }
.f-sym { font: 600 1.05rem var(--f-display); text-align: left; justify-self: start; }
.f-sym.tok { color: var(--ice); }
.f-note { font-size: .9rem; color: var(--dim); min-width: 0; overflow-wrap: anywhere; }
.f-note b { color: var(--bone); font-weight: 500; }
.f-proof { font: .8rem var(--f-mono); white-space: nowrap; }
.feed-foot { display: flex; align-items: center; gap: 1.2rem; margin-top: 1.2rem; }
.state { color: var(--dim); font-size: .92rem; }
.state.err { color: var(--bone); }
@media (max-width: 860px) {
  .feed li { grid-template-columns: auto minmax(0, 1fr); gap: .2rem 1rem; }
  .f-at { grid-column: 1 / -1; }
  .f-kind { grid-column: 2; grid-row: 2; text-align: right; }
  .f-sym { grid-column: 1; grid-row: 2; }
  .f-note { grid-column: 1 / -1; }
  .f-proof { grid-column: 1 / -1; }
}

/* Lookup: asymmetric split */
.lookup {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(1.5rem, 5vw, 5rem);
  margin: clamp(2rem, 6vw, 4rem) var(--pad); padding: clamp(1.8rem, 4vw, 3rem);
  background: var(--ink-2); border: 1px solid var(--line);
}
.lookup-side > p { margin-top: 1rem; color: var(--dim); max-width: 26rem; }
.lookup-form { margin-top: 1.6rem; }
.lookup-form label { display: block; font-size: .82rem; color: var(--dim); margin-bottom: .45rem; }
.lookup-row { display: flex; gap: .5rem; }
.lookup-row input {
  flex: 1; min-width: 0; min-height: 2.9rem; padding: 0 .9rem;
  background: var(--ink); color: var(--bone); border: 1px solid var(--line); border-radius: 2px;
  font: 1rem var(--f-mono); text-transform: uppercase;
}
.lookup-row input::placeholder { color: var(--dim); }
.lookup-row input:focus { border-color: var(--ice); outline: none; }
.try { margin-top: 1rem; font-size: .88rem; color: var(--dim); }
.lookup-out { min-height: 14rem; border-left: 1px solid var(--line); padding-left: clamp(1rem, 3vw, 2.5rem); }
.tk-name { font: 800 clamp(2rem, 4vw, 3rem)/1 var(--f-display); letter-spacing: -0.03em; }
.tk-sub { margin-top: .4rem; font-size: .9rem; color: var(--dim); overflow-wrap: anywhere; }
.tk-sub code { color: var(--bone); }
.path { list-style: none; margin: 1.6rem 0 0; padding: 0; position: relative; }
.path li { position: relative; padding: 0 0 1.3rem 1.6rem; }
.path li::before { content: ""; position: absolute; left: 0; top: .45rem; width: 9px; height: 9px; border: 1px solid var(--bone); transform: rotate(45deg); }
.path li.tok::before { border-color: var(--ice); background: var(--ice); }
.path li:not(:last-child)::after { content: ""; position: absolute; left: 4px; top: 1.1rem; bottom: .1rem; width: 1px; background: var(--line); }
.p-k { font-weight: 600; }
.p-at { font: .8rem var(--f-mono); color: var(--dim); margin-left: .6rem; }
.p-gap { display: block; font: .78rem var(--f-mono); color: var(--ice); margin-top: .15rem; }
.p-note { display: block; font-size: .88rem; color: var(--dim); overflow-wrap: anywhere; }
@media (max-width: 860px) {
  .lookup { grid-template-columns: 1fr; }
  .lookup-out { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 1.5rem; }
}

/* Gaps */
.gaps { padding: clamp(3rem, 7vw, 6rem) var(--pad) 2rem; }
.gaps-intro { margin-top: 1rem; max-width: 40rem; color: var(--dim); }
.gaps-split { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); margin-top: 2.2rem; }
.gaps h3 { padding-bottom: .8rem; border-bottom: 1px solid var(--line); font-weight: 500; }
.gaps h3 span { font: 800 1.6rem var(--f-display); margin-right: .35rem; }
.chips { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem .9rem; max-height: 16rem; overflow-y: auto; scrollbar-color: var(--line) transparent; scrollbar-width: thin; font: .82rem/1.8 var(--f-mono); color: var(--dim); }
.chips button { background: none; border: 0; padding: 0; font: inherit; color: var(--dim); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.chips button:hover { color: var(--ice); text-decoration-color: var(--ice); }
@media (max-width: 760px) { .gaps-split { grid-template-columns: 1fr; } }

/* Catalogue */
.catalogue { padding: clamp(3rem, 7vw, 6rem) var(--pad) 2rem; max-width: 64rem; }
.catalogue > p { margin-top: .9rem; color: var(--dim); }
.cat { width: 100%; margin-top: 1.8rem; border-collapse: collapse; font-size: .95rem; }
.cat th { text-align: left; font: 400 .78rem var(--f-mono); color: var(--dim); padding: 0 1rem .6rem 0; border-bottom: 1px solid var(--bone); }
.cat td { padding: .85rem 1rem .85rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.cat td:first-child { font-weight: 600; white-space: nowrap; }
.cat td:nth-child(2) { color: var(--dim); }
.cat td:last-child { font: .82rem var(--f-mono); white-space: nowrap; }
.st-live { color: var(--ice); }
.st-part { color: var(--bone); }
.st-next { color: var(--dim); }
@media (max-width: 640px) {
  .cat thead { display: none; }
  .cat tr { display: grid; grid-template-columns: 1fr auto; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .cat td { border: 0; padding: 0; }
  .cat td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; font-size: .88rem; }
}

/* Agent: a single wide statement, no cards */
.agent { padding: clamp(3rem, 7vw, 6rem) var(--pad); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(1rem, 4vw, 4rem); border-top: 1px solid var(--line); margin-top: clamp(2rem, 5vw, 4rem); }
.agent-body > p:first-child { font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.55; max-width: 44rem; }
.checks { margin: 1.8rem 0 0; padding: 0; list-style: none; counter-reset: c; display: grid; gap: .6rem; }
.checks li { counter-increment: c; display: grid; grid-template-columns: 2.2rem 1fr; color: var(--dim); }
.checks li::before { content: "0" counter(c); font: .8rem/1.9 var(--f-mono); color: var(--ice); }
.checks b { color: var(--bone); font-weight: 600; }
.agent-status { margin-top: 1.6rem; font: .86rem var(--f-mono); }
@media (max-width: 760px) { .agent { grid-template-columns: 1fr; } }

/* API */
.api { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(1.5rem, 4vw, 4rem); padding: clamp(3rem, 7vw, 5rem) var(--pad); background: var(--ink-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.api-copy > p { margin-top: .9rem; color: var(--dim); }
.ends { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .4rem; }
.ends code { color: var(--bone); }
.api-cmd { font-size: .9rem; color: var(--ice); overflow-wrap: anywhere; }
.api-live pre { scrollbar-color: var(--line) transparent; margin: .8rem 0 0; padding: 1.1rem; background: var(--ink); border: 1px solid var(--line); color: var(--dim); max-height: 22rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 860px) { .api { grid-template-columns: 1fr; } }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 2rem var(--pad) 2.5rem; font-size: .85rem; color: var(--dim); }
