/* emit. One idea per screen, and as few numbers as the idea needs.
   The palette and the terminal register come from @emitdotyield and do not move. */

:root {
  --bg: #07060c;
  --lift: #17112a;
  --field: #1d1236;
  --card: #100d18;
  --sunk: #0b0912;
  --line: #201b31;
  --struct: #514a66;
  --ink: #eae7f2;
  --dim: #9a93b0;
  --faint: #6b6482;
  --violet: #724aff;
  --lav: #a78bfa;
  --warn: #e0a458;
  --dead: #5d576f;
  --top: 56px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100dvh; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-rows: var(--top) auto minmax(0, 1fr);
  opacity: 0;
  transition: opacity 0.2s;
}
body.ready { opacity: 1; }
@media (prefers-reduced-motion: reduce) { body { transition: none; opacity: 1; } }

a { color: var(--lav); text-decoration: none; }
a:hover { text-decoration: underline; }

.wall {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 820px at 14% -12%, var(--lift), transparent 64%),
    radial-gradient(1400px 980px at 104% 108%, var(--field), transparent 66%),
    var(--bg);
}

/* A pixel matrix rather than a line grid: it rhymes with the emitter marks, and a dot
   disappears at low opacity in a way a hairline never quite does. */
.wall .matrix {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(167, 139, 250, 0.16) 1px, transparent 1.2px);
  background-size: 24px 24px;
  opacity: 0.9;
}

.wall .arcs { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Pulls the light back to the edges so the reading column sits on something quiet. */
.wall .vig {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(105% 95% at 50% 40%, rgba(7, 6, 12, 0.86) 10%, rgba(7, 6, 12, 0.35) 52%, transparent 84%),
    linear-gradient(180deg, rgba(7, 6, 12, 0.9), transparent 14%);
}

/* ------------------------------------------------------------------ top bar */

.top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.mark { font-size: 15.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 9px; }
/* The gap applies between every flex child, so the wordmark's own spans have to be one
   child or `emit(stocks)` comes apart into `emit ( stocks )`. */
.mark .wm { display: inline; }
.mark .mk { width: 21px; height: 14px; color: var(--violet); flex: none; }
.mark em { color: var(--violet); font-style: normal; }
.mark i {
  display: inline-block;
  width: 7px; height: 12px;
  background: var(--violet);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1.15s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mark i { animation: none; } }

.nav { display: flex; gap: 2px; }
.navitem {
  font: inherit;
  font-size: 14.5px;
  color: var(--faint);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 18px 15px 16px;
  cursor: pointer;
}
.navitem:hover { color: var(--dim); }
.navitem.on { color: var(--ink); border-bottom-color: var(--violet); }

.grow { flex: 1; }
.stat { font-size: 13px; color: var(--faint); white-space: nowrap; }
.stat b { color: var(--dim); font-weight: 500; }
.stat.sep { padding-left: 14px; border-left: 1px solid var(--line); }

.mbtn {
  font: inherit;
  font-size: 13px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.mbtn:hover { color: var(--ink); border-color: var(--struct); }
/* Not connected is the state that needs an invitation, so that is the state that gets the
   filled button. Once connected the button is just a status and steps back. */
.mbtn.cta { color: var(--ink); border-color: var(--violet); background: rgba(114, 74, 255, 0.2); }
.mbtn.cta:hover { background: rgba(114, 74, 255, 0.32); }
.mbtn.real { color: var(--lav); border-color: rgba(167, 139, 250, 0.35); }
.mbtn.warn { color: var(--warn); border-color: rgba(224, 164, 88, 0.4); }

.banner {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  background: linear-gradient(90deg, rgba(114, 74, 255, 0.12), rgba(114, 74, 255, 0.03) 60%, transparent);
  border-bottom: 1px solid var(--line);
  padding: 9px 28px;
}
.banner .pill {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink);
  background: var(--violet);
  border-radius: 3px;
  padding: 3px 9px;
}
.banner .bmain { color: var(--lav); letter-spacing: 0.06em; }
.banner .bsub { color: var(--faint); font-size: 12.5px; }

/* ------------------------------------------------------------------ page */

main { overflow-y: auto; min-height: 0; }
.col { max-width: 1280px; margin: 0 auto; padding: 26px 28px 56px; }

/* Two columns on a wide screen. The old single 900px column turned every screen into a
   scroll on a display with room to spare. */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.cols > div { min-width: 0; }
.panel.tall { display: flex; flex-direction: column; min-height: 100%; }

.lede {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--dim);
  max-width: 86ch;
  margin: 0 0 20px;
}
.lede b { color: var(--ink); font-weight: 500; }
.inlinelink {
  font: inherit;
  color: var(--lav);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* NEVER uppercase this class: it carries tickers, and `aAAPL` uppercased reads `AAAPL`.
   Third time this bit, hence the shouting. Labels are written in the case they should read. */
.lbl {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.sub { font-size: 13.5px; color: var(--faint); line-height: 1.55; }
.sub b { color: var(--dim); font-weight: 500; }
.sub.warn { color: var(--warn); }
.unit { font-size: 15px; color: var(--faint); }
.lav { color: var(--lav); }
.dead { color: var(--dead); }
.warn { color: var(--warn); }
.mono { font-family: var(--mono); }
.n { text-align: right; font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 5px; margin-bottom: 18px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 9px; }

/* crispEdges on the svg keeps the cells square; this keeps them square when scaled too. */
.plogo { display: block; image-rendering: pixelated; flex: none; }
.plogo.big { opacity: 1; }
/* The mark is the bridge between the two sides of the comparison, so it carries the accent
   rather than sitting in the structural grey. */
.markwrap {
  display: grid;
  place-items: center;
  color: var(--violet);
  padding: 0 6px;
  filter: drop-shadow(0 0 22px rgba(114, 74, 255, 0.35));
}
.cell { display: inline-flex; align-items: center; gap: 10px; }
.tab {
  font: inherit;
  font-size: 14px;
  color: var(--faint);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
}
.tab:hover { color: var(--ink); border-color: var(--struct); }
.tab.on { color: var(--ink); border-color: var(--violet); background: rgba(114, 74, 255, 0.14); }

/* ------------------------------------------------------------------ the comparison */

/* The only thing this product has to land: the token you can buy pays nothing, and this one
   pays what the company returned. Everything else on the page is smaller than this. */
.compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 26px 30px;
  max-width: 1120px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sunk);
  margin-bottom: 18px;
}
.compare .side.live { }
.compare .rate {
  font-size: 62px;
  line-height: 1;
  letter-spacing: -0.035em;
  margin: 10px 0 8px;
  font-variant-numeric: tabular-nums;
  color: var(--lav);
}
.compare .rate.dead { color: var(--dead); }
.compare .rate.small { font-size: 38px; }
.compare .side .unit { font-size: 14px; }

.tagcalc {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px 6px;
  margin-left: 8px;
}
.panel.ok { border-color: rgba(167, 139, 250, 0.26); }
.panel.wait { border-color: rgba(224, 164, 88, 0.22); }

.tagwarn {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--warn);
  border: 1px solid rgba(224, 164, 88, 0.32);
  border-radius: 2px;
  padding: 1px 6px;
  margin-left: 8px;
}

.calc { border-color: rgba(224, 164, 88, 0.22); }
.calcrow { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-top: 16px; }
.calcrow label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--faint); }
.calcrow .inline { display: flex; align-items: center; }
.calcrow .pre {
  color: var(--faint);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 4px 0 0 4px;
  padding: 8px 10px;
  background: var(--sunk);
}
.calcrow input { border-radius: 0 4px 4px 0; width: 150px; }
.calcrow button {
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  border: 1px solid var(--violet);
  background: rgba(114, 74, 255, 0.16);
  border-radius: 4px;
  padding: 8px 14px;
  cursor: pointer;
}

.result { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.result .rate { font-size: 54px; letter-spacing: -0.03em; margin: 8px 0 10px; color: var(--lav); }
.result .rate.dead { color: var(--dead); }
.result .sub { max-width: 60ch; }

.compare .sub { max-width: 38ch; }
.compare .side:last-child { text-align: right; }
.compare .side:last-child .sub { margin-left: auto; }

/* ------------------------------------------------------------------ panels */

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.ph {
  font-size: 11.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 16px;
}
.tagsim {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--lav);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 2px;
  padding: 1px 6px;
  margin-left: 8px;
}

.two { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 22px; align-items: start; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 16px; }
.hair { align-self: stretch; background: linear-gradient(180deg, transparent, var(--violet), transparent); }

.mid {
  font-size: 32px;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 7px;
}

.claimrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.claimrow .mid { margin: 0; }

.ghost {
  margin-top: 18px;
  font: inherit;
  font-size: 12.5px;
  color: var(--lav);
  background: transparent;
  border: 1px solid rgba(167, 139, 250, 0.26);
  border-radius: 4px;
  padding: 7px 13px;
  cursor: pointer;
}
.ghost:hover { background: rgba(167, 139, 250, 0.09); }

.acts { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.acts .sub { margin-left: 4px; }

input[type="number"], .termform input {
  font: inherit;
  font-size: 15px;
  background: var(--sunk);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 13px;
  border-radius: 4px;
  width: 146px;
  font-variant-numeric: tabular-nums;
}
input:focus { outline: none; border-color: var(--violet); }

button.primary, .acts button {
  font: inherit;
  font-size: 14px;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 16px;
  cursor: pointer;
}
.acts button:hover:not(:disabled), button.primary:hover:not(:disabled) { color: var(--ink); border-color: var(--struct); }
button.primary { color: var(--ink); border-color: var(--violet); background: rgba(114, 74, 255, 0.16); }
button.primary:hover:not(:disabled) { background: rgba(114, 74, 255, 0.26); }
button:disabled { opacity: 0.3; cursor: not-allowed; }

.kv {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(32, 27, 49, 0.6);
  font-size: 14px;
}
.kv:last-child { border-bottom: 0; }
.kv > span { color: var(--faint); }
.kv > b { font-weight: 500; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ how */

.diagram {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sunk);
  padding: 12px;
  margin-bottom: 18px;
}
/* The diagram is 4:1, so on a wide column it alone eats 300px of height. Letterbox it
   rather than let it push the rest of the page below the fold. */
.diagram svg { display: block; width: 100%; height: auto; max-height: 200px; margin: 0 auto; }
.diagram svg.hero-narrow { display: none; }

.steps { display: grid; gap: 14px; align-content: start; }
.step {
  font-size: 15px;
  padding-top: 2px;
  padding-bottom: 2px;
  color: var(--dim);
  padding-left: 14px;
  border-left: 2px solid var(--violet);
}
.step b {
  display: inline-block;
  width: 18px;
  color: var(--violet);
  font-weight: 500;
}

.ev {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid rgba(32, 27, 49, 0.55);
  font-size: 13.5px;
  color: var(--dim);
}
.ev:last-child { border-bottom: 0; }
.ev a { font-size: 12.5px; }

/* ------------------------------------------------------------------ table */

.tablewrap { overflow-x: auto; margin-bottom: 22px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
table.grid th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.grid th.n { text-align: right; }
table.grid td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(32, 27, 49, 0.55);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.grid tr.off td { color: var(--faint); white-space: normal; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: rgba(114, 74, 255, 0.05); }
table.grid tbody tr.on { background: rgba(114, 74, 255, 0.11); }
table.grid tr.off { cursor: default; }

/* ------------------------------------------------------------------ terminal */

.term {
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sunk);
  padding: 16px;
}
.tl-in { color: var(--ink); }
.tl-out { color: var(--dim); }
.tl-err { color: var(--warn); }
.tl-sys { color: var(--faint); }
.tp { color: var(--violet); }
.termform { display: flex; align-items: center; gap: 9px; margin-top: 12px; }
.termform input { flex: 1; width: auto; }

/* ------------------------------------------------------------------ wallet sheet */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 3, 7, 0.6);
  display: none;
  justify-content: flex-end;
  padding: calc(var(--top) + 10px) 16px 16px;
}
.sheet.on { display: flex; }
.sheet-card {
  position: relative;
  width: min(380px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--violet);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 24px 64px #00000077;
}
.sheet-x {
  position: absolute;
  top: 10px; right: 10px;
  width: 26px; height: 26px;
  font: inherit;
  font-size: 15px;
  color: var(--faint);
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.sheet-x:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.sheet-h { font-size: 14px; margin-bottom: 8px; padding-right: 26px; }
.providers { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.provider {
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--sunk);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 11px 13px;
  cursor: pointer;
  text-align: left;
}
.provider:hover { border-color: var(--violet); }
.pdot { width: 8px; height: 8px; border-radius: 50%; background: var(--violet); }

/* ------------------------------------------------------------------ toast */

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 70;
  background: var(--card);
  border: 1px solid var(--violet);
  padding: 10px 16px;
  border-radius: 5px;
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
  max-width: min(520px, calc(100vw - 32px));
}
#toast.on { opacity: 1; }

/* ------------------------------------------------------------------ narrow */

/* One column well before the two would start fighting for width. */
@media (max-width: 1080px) {
  .cols { grid-template-columns: 1fr; }
  /* Three narrow columns stop working before two do, so they step down separately. */
  .cols3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel.tall { min-height: 0; }
}

@media (max-width: 860px) {
  .top { flex-wrap: wrap; gap: 0 14px; padding: 0 14px; height: auto; }
  body { grid-template-rows: auto auto minmax(0, 1fr); }
  .mark { padding: 12px 0 0; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .navitem { padding: 12px 11px 10px; }
  .stat { display: none; }
  .mbtn { margin-left: auto; }
  .compare { grid-template-columns: 1fr; gap: 18px; padding: 22px; }
  .compare .vs { transform: rotate(90deg); justify-self: start; }
  .cols3 { grid-template-columns: 1fr; }
  .compare { padding: 20px; gap: 14px; }
  .compare .rate { font-size: 44px; margin: 6px 0 6px; }
  .compare .rate.small { font-size: 32px; }
  .result .rate { font-size: 42px; }
  .mid { font-size: 28px; }
  .two, .three { grid-template-columns: 1fr; gap: 16px; }
  .hair { height: 1px; background: linear-gradient(90deg, transparent, var(--violet), transparent); }
  .col { padding: 18px 16px 56px; }
  .banner { padding: 8px 16px; gap: 8px; }
  .banner .bsub { display: none; }
  /* In one column the right-hand side reads as a stray indent, and the mark becomes the
     separator between the two halves rather than the bridge across them. */
  .compare .side:last-child { text-align: left; }
  .compare .side:last-child .sub { margin-left: 0; }
  .markwrap { justify-self: start; padding: 2px 0; }
  .markwrap .plogo { width: 34px; height: 34px; }
  .lede { font-size: 15.5px; margin-bottom: 16px; }
  .panel { padding: 16px; margin-bottom: 14px; }
  .mid { font-size: 26px; margin: 6px 0 5px; }
  /* Five tickers wrap to two rows at 390 and cost a row of height for one tab. */
  .tabs { margin-bottom: 14px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .tab { flex: none; }
  .steps { gap: 10px; }
  /* A phone shows the two most recent events; the rest is a tap away on How. */
  .ev:nth-child(n + 5) { display: none; }
  .diagram svg.hero-wide { display: none; }
  .diagram svg.hero-narrow { display: block; }
  .sheet { padding: 12px; align-items: flex-end; }
  .sheet-card { width: 100%; }
}
