:root {
  --bg: #0a0b09;
  --surface: #111310;
  --surface-2: #181b16;
  --line: rgba(236, 239, 230, 0.1);
  --line-strong: rgba(236, 239, 230, 0.24);
  --text: #ecefe6;
  --muted: #9aa192;
  --faint: #6f7668;
  --accent: #76b900;
  --accent-hi: #8ed60a;
  --on-accent: #0a0b09;
  --danger: #ff7a66;

  --sans: "Geist", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --wrap: 1120px;
  --gutter: 24px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f5f0;
  --surface: #fcfdfa;
  --surface-2: #e9ece2;
  --line: rgba(18, 20, 15, 0.12);
  --line-strong: rgba(18, 20, 15, 0.32);
  --text: #12140f;
  --muted: #555c4d;
  --faint: #7b8273;
  --accent: #4a7700;
  --accent-hi: #3b6000;
  --on-accent: #ffffff;
  --danger: #b3301c;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  flex: 1;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
}

h1 {
  font-weight: 500;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.mono {
  font-family: var(--mono);
}

.eyebrow {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.eyebrow b {
  font-weight: 500;
}

/* Dot-matrix artwork is drawn light-on-dark. On the light theme it is flipped
   so the dots turn dark and the green stays green. */
:root[data-theme="light"] .dither {
  filter: invert(1) hue-rotate(180deg) saturate(1.6) brightness(0.82);
}

.muted {
  color: var(--muted);
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: 500 14px/1 var(--sans);
  color: var(--text);
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover:not(:disabled) {
  border-color: var(--text);
}

.btn-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn-solid:hover:not(:disabled) {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.btn-wallet.connected {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.btn-wallet.connected::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.btn-wallet.warn::before {
  background: var(--danger);
}

.link {
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color 0.15s;
}

.link:hover {
  border-color: var(--accent);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 2px;
  color: var(--muted);
  transition: color 0.15s;
}

.icon-btn:hover {
  color: var(--text);
}

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

#site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.mark {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 5px;
}

.nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font-size: 14px;
  font-weight: 500;
}

.nav a {
  color: var(--muted);
  transition: color 0.15s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
}

.actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.actions .btn {
  margin-left: 8px;
  height: 36px;
}

.menu-btn {
  display: none;
}

@media (max-width: 760px) {
  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    font-size: 16px;
  }

  .nav a {
    padding: 12px 0;
  }

  #site-header.open .nav {
    display: flex;
  }

  .actions {
    margin-left: auto;
  }

  .menu-btn {
    display: inline-grid;
  }

  .bar {
    gap: 12px;
  }
}

.nav .only-mobile {
  display: none;
}

@media (max-width: 760px) {
  .nav .only-mobile {
    display: block;
  }
}

@media (max-width: 480px) {
  :root {
    --gutter: 16px;
  }

  /* The X link moves into the menu and the theme switch gives way to the wallet button. */
  .actions a.icon-btn,
  .actions button.icon-btn:not(.menu-btn) {
    display: none;
  }

  .actions .btn {
    margin-left: 0;
    padding: 0 12px;
    font-size: 13px;
  }

  .brand {
    font-size: 15px;
  }

}

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  text-align: center;
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding-top: 88px;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.25rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.hero .lede {
  max-width: 56ch;
  margin: 20px auto 0;
  font-size: clamp(1rem, 1.5vw, 1.1875rem);
  color: var(--muted);
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.hero-actions .btn {
  height: 48px;
  padding: 0 22px;
  border-radius: 8px;
  font-size: 15px;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  margin-top: 22px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.pill b {
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.pill .dot {
  margin-right: 0;
}

.pill-copy {
  font-size: 12px;
  color: var(--muted);
}

.pill-copy:hover {
  color: var(--text);
}

.pill-cta {
  margin-right: -9px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  font-size: 12.5px;
}

/* The animated scene has no frame: it is drawn straight onto the page and
   slides a little way up under the pills. */
.scene {
  display: block;
  width: 100%;
  margin-top: 4px;
  pointer-events: none;
}

/* ---------------------------------------------------------------- doors */

.center-head {
  display: grid;
  gap: 14px;
  justify-items: center;
  margin-bottom: 44px;
  text-align: center;
}

.center-head > p:not(.eyebrow) {
  max-width: 62ch;
  color: var(--muted);
  text-wrap: pretty;
}

.center-head h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  letter-spacing: -0.04em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  transform: translateY(-2px);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--accent);
}

.card-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  margin-top: 12px;
  font-size: 1.375rem;
  letter-spacing: -0.025em;
}

.card > p:not(.eyebrow) {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  text-wrap: pretty;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: auto;
  padding-top: 24px;
}

.section.section-doors {
  border-top: 0;
  padding-top: 8px;
}

.token-logo {
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 22px;
  border-radius: 13px;
}

@media (max-width: 860px) {
  .cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-copy {
    padding-top: 56px;
  }

  .scene {
    margin-top: -8px;
  }
}

.ask {
  display: flex;
  align-items: center;
  width: min(100%, 580px);
  height: 58px;
  margin: 36px auto 0;
  text-align: left;
  padding: 0 8px 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  transition: border-color 0.15s;
}

.ask:focus-within {
  border-color: var(--accent);
}

.ask input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font: 400 16px var(--sans);
}

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

.send {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 2px;
  background: var(--accent);
  color: var(--on-accent);
  transition: background-color 0.15s;
}

.send:hover:not(:disabled) {
  background: var(--accent-hi);
}

.send:disabled {
  opacity: 0.4;
}

.live {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  min-height: 20px;
  margin-top: 18px;
  font: 400 12.5px/1.6 var(--mono);
  color: var(--muted);
}

.live span b {
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--faint);
  vertical-align: 1px;
}

.dot.on {
  background: var(--accent);
}

.art {
  display: block;
  width: 100%;
  height: clamp(200px, 30vw, 340px);
}

.art-card {
  max-width: 460px;
  height: 168px;
  margin: 0 auto 36px;
}

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

.section {
  padding: 96px 0;
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: 16px;
  margin-bottom: 48px;
}

.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.section-head p {
  max-width: 58ch;
  color: var(--muted);
  text-wrap: pretty;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 48px 64px;
  align-items: start;
}

@media (max-width: 860px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------------------------------------------------------------- code + tables */

.code {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
}

.code-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 6px 0;
  border-bottom: 1px solid var(--line);
}

.code-tabs button {
  padding: 8px 12px;
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
}

.code-tabs button[aria-selected="true"] {
  color: var(--text);
  border-color: var(--accent);
}

.code-tabs .copy {
  margin-left: auto;
}

pre {
  margin: 0;
  padding: 18px;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 400 13px/1.65 var(--mono);
  color: var(--text);
  tab-size: 2;
}

.code-note {
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
}

.table-wrap::-webkit-scrollbar {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font: 400 12.5px/1.4 var(--mono);
  font-variant-numeric: tabular-nums;
}

th,
td {
  max-width: 220px;
  padding: 12px 14px;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

th {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

td .link {
  font: inherit;
}

td.num,
th.num {
  text-align: right;
}

.empty {
  padding: 28px 16px;
  font: 400 13px/1.5 var(--sans);
  color: var(--muted);
  white-space: normal;
}

.sub-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 56px 0 16px;
}

.sub-head h3 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

/* key / value lists */

.kvs {
  border-top: 1px solid var(--line);
}

.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 52px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.kv .k {
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.kv .v {
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.kv .ok::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}

.kv .link {
  font-size: 13px;
}

.note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  margin-top: 32px;
}

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

#site-footer {
  border-top: 1px solid var(--line);
}

.foot {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px 48px;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 40px var(--gutter) 48px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 14px;
  color: var(--muted);
}

.foot-links a:hover {
  color: var(--text);
}

.legal {
  grid-column: 1 / -1;
  max-width: 92ch;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--faint);
}

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

/* ---------------------------------------------------------------- dialog + toast */

.sheet {
  width: min(92vw, 400px);
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

.sheet::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.sheet-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.sheet-head h2 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.sheet-close {
  font-size: 13px;
  color: var(--muted);
}

.sheet-close:hover {
  color: var(--text);
}

.sheet-note {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.sheet-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.wallet-list {
  display: grid;
  gap: 8px;
}

.wallet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-weight: 500;
  font-size: 15px;
  text-align: left;
  transition: border-color 0.15s;
}

.wallet-option:hover:not(:disabled) {
  border-color: var(--accent);
}

.wallet-option:disabled {
  opacity: 0.5;
}

.wallet-option img {
  border-radius: 4px;
}

.wallet-dot {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface-2);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------------------------------------- chat */

.chat-page main {
  display: flex;
  flex-direction: column;
}

.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding: 0 var(--gutter);
}

.chat-intro {
  margin: auto 0;
  padding: 48px 0 32px;
  text-align: center;
}

.chat-intro h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.04em;
}

.chat-intro p {
  margin-top: 12px;
  color: var(--muted);
}

.messages {
  flex: 1;
  display: none;
  flex-direction: column;
  gap: 28px;
  padding: 40px 0 24px;
}

.chat.started .messages {
  display: flex;
}

.chat.started .chat-intro {
  display: none;
}

.msg {
  display: grid;
  gap: 8px;
}

.msg .who {
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.msg.user .body {
  color: var(--muted);
}

.msg .body {
  overflow-wrap: anywhere;
}

.msg .body > * + * {
  margin-top: 12px;
}

.msg .body ul,
.msg .body ol {
  margin: 12px 0 0;
  padding-left: 22px;
}

.msg .body li + li {
  margin-top: 4px;
}

.msg .body code {
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--surface-2);
  font: 400 0.875em var(--mono);
}

.msg .body pre {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
}

.msg .body pre code {
  padding: 0;
  background: none;
  font-size: 13px;
}

.msg .meta {
  font: 400 12px/1.5 var(--mono);
  color: var(--faint);
}

.msg .meta a {
  border-bottom: 1px solid var(--line-strong);
}

.msg .error {
  color: var(--danger);
}

.cursor::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 1em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

.composer {
  position: sticky;
  bottom: 0;
  padding: 12px 0 20px;
  background: linear-gradient(to top, var(--bg) 82%, transparent);
}

.composer-box {
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  transition: border-color 0.15s;
}

.composer-box:focus-within {
  border-color: var(--accent);
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  max-height: 200px;
  padding: 16px 16px 4px;
  border: 0;
  outline: 0;
  resize: none;
  background: none;
  color: var(--text);
  font: 400 16px/1.5 var(--sans);
}

.composer textarea::placeholder {
  color: var(--faint);
}

.composer-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 8px;
}

.composer-row .send {
  margin-left: auto;
  width: 36px;
  height: 36px;
}

.seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.seg button {
  height: 28px;
  padding: 0 10px;
  border-radius: 1px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.seg button[aria-pressed="true"],
.seg button[aria-selected="true"] {
  background: var(--surface-2);
  color: var(--text);
}

.seg button:disabled {
  opacity: 0.4;
}

.select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text);
  font: 400 13px var(--sans);
}

.statusline {
  min-height: 18px;
  margin-top: 8px;
  font: 400 12px/1.5 var(--mono);
  color: var(--muted);
}

.progress {
  height: 2px;
  margin-top: 6px;
  background: var(--line);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s linear;
}

/* ---------------------------------------------------------------- earn */

.narrow {
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
  padding: 72px var(--gutter) 96px;
}

.narrow .head {
  text-align: center;
}

.narrow .head h1 {
  margin-top: 20px;
  font-size: clamp(2.1rem, 5.4vw, 3.5rem);
  letter-spacing: -0.04em;
}

.narrow .head p {
  max-width: 46ch;
  margin: 16px auto 0;
  color: var(--muted);
  text-wrap: pretty;
}

.tabs {
  display: flex;
  justify-content: center;
  margin: 36px 0 24px;
}

.tabs .seg button {
  height: 34px;
  padding: 0 16px;
  font-size: 14px;
}

.panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
}

.panel h2 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.panel > * + * {
  margin-top: 20px;
}

@media (max-width: 520px) {
  .panel {
    padding: 20px;
  }
}

.tiers {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.panel > .tiers {
  margin-top: 28px;
}

.tiers legend {
  padding: 0;
  margin-bottom: 12px;
}

.tier {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.tier:has(input:checked) {
  border-color: var(--accent);
}

.tier:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

.tier input {
  accent-color: var(--accent);
  margin: 0;
}

.tier .t-name {
  font-weight: 500;
  font-size: 15px;
}

.tier .t-meta {
  margin-left: auto;
  font: 400 12px var(--mono);
  color: var(--muted);
  text-align: right;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 2px;
}

.stat {
  padding: 14px;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat .n {
  font: 500 1.375rem/1.1 var(--mono);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat .l {
  margin-top: 6px;
  font: 500 10.5px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 520px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat:nth-child(2) {
    border-right: 0;
  }

  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.steps li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: 8px;
  font: 500 11px var(--mono);
  letter-spacing: 0.08em;
  color: var(--accent);
}

.steps pre {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg);
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}


/* ---------------------------------------------------------------- background */

/* The page background is chosen with data-bg on <html> (set from config.js):
   "aurora", "lines", "blueprint" or "grain". All of them move with
   transforms only, so they cost nothing while scrolling. */

:root {
  --bg-line: rgba(236, 239, 230, 0.055);
  --bg-light: rgba(118, 185, 0, 0.16);
  --bg-light-2: rgba(60, 140, 90, 0.12);
  --bg-grain: 0.07;
}

:root[data-theme="light"] {
  --bg-line: rgba(18, 20, 15, 0.07);
  --bg-light: rgba(118, 185, 0, 0.16);
  --bg-light-2: rgba(60, 140, 90, 0.1);
  --bg-grain: 0.05;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
}

/* --- aurora: slow lights under a film of grain */
:root[data-bg="aurora"] body::before {
  inset: -30vh -30vw;
  background:
    radial-gradient(38vw 34vh at 30% 28%, var(--bg-light), transparent 70%),
    radial-gradient(34vw 38vh at 72% 62%, var(--bg-light-2), transparent 70%),
    radial-gradient(28vw 26vh at 58% 18%, var(--bg-light-2), transparent 70%);
  animation: bg-wander 46s ease-in-out infinite alternate;
}

:root[data-bg="aurora"] body::after,
:root[data-bg="grain"] body::after {
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: var(--bg-grain);
}

/* --- lines: the scene's floor, carried across the whole page */
:root[data-bg="lines"] body::before {
  inset: -120px;
  background:
    repeating-linear-gradient(116.565deg, var(--bg-line) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(63.435deg, var(--bg-line) 0 1px, transparent 1px 56px);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 34%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 70% at 50% 34%, #000 20%, transparent 78%);
  animation: bg-slide 18s linear infinite;
}

:root[data-bg="lines"] body::after {
  top: -20vh;
  left: 15vw;
  width: 70vw;
  height: 70vh;
  background: radial-gradient(closest-side, var(--bg-light), transparent);
  animation: bg-breathe 9s ease-in-out infinite alternate;
}

/* --- blueprint: a square grid with a band of light sweeping across */
:root[data-bg="blueprint"] body::before {
  inset: 0;
  background:
    linear-gradient(var(--bg-line) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(90deg, var(--bg-line) 1px, transparent 1px) 0 0 / 72px 72px;
  -webkit-mask-image: linear-gradient(to bottom, #000, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000, #000 55%, transparent);
}

:root[data-bg="blueprint"] body::after {
  top: 0;
  bottom: 0;
  left: -45vw;
  width: 45vw;
  background: linear-gradient(100deg, transparent, var(--bg-light) 50%, transparent);
  animation: bg-sweep 11s ease-in-out infinite;
}

/* --- grain: matte black with one light breathing at the top */
:root[data-bg="grain"] body::before {
  top: -25vh;
  left: 10vw;
  width: 80vw;
  height: 80vh;
  background: radial-gradient(closest-side, var(--bg-light), transparent);
  animation: bg-breathe 10s ease-in-out infinite alternate;
}

@keyframes bg-wander {
  0% {
    transform: translate(-8vw, -4vh) rotate(0deg);
  }
  50% {
    transform: translate(10vw, 8vh) rotate(8deg);
  }
  100% {
    transform: translate(-4vw, 14vh) rotate(-6deg);
  }
}

@keyframes bg-slide {
  to {
    transform: translate(100.2px, 50.1px);
  }
}

@keyframes bg-breathe {
  from {
    opacity: 0.55;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes bg-sweep {
  0% {
    transform: translateX(0);
  }
  70%,
  100% {
    transform: translateX(190vw);
  }
}

/* Thin, quiet scrollbars wherever one is still needed. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

/* ---------------------------------------------------------------- document pages (API, Token) */

.doc {
  width: 100%;
  max-width: 860px;
  margin-inline: auto;
  padding: 80px var(--gutter) 104px;
}

.doc h1 {
  margin-top: 18px;
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.04em;
}

.doc .lede {
  max-width: 62ch;
  margin-top: 18px;
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  color: var(--muted);
  text-wrap: pretty;
}

.doc h2 {
  margin: 56px 0 16px;
  font-size: 1.375rem;
  letter-spacing: -0.025em;
}

.doc > p:not(.eyebrow):not(.lede):not(.note) {
  max-width: 68ch;
  color: var(--muted);
}

.doc p code,
.doc td code {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  font: 400 0.875em var(--mono);
  color: var(--text);
}

.doc .code {
  margin-top: 16px;
  border-radius: 10px;
  overflow: hidden;
}

.doc .code-tabs {
  min-height: 40px;
}

.copy-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.copy-field code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font: 400 14px/1.5 var(--mono);
}

.copy-field .btn {
  height: 36px;
}

.doc .table-wrap {
  border-radius: 10px;
}

.doc-table {
  font-family: var(--sans);
  font-size: 14px;
}

.doc-table th,
.doc-table td {
  max-width: none;
  white-space: normal;
  vertical-align: top;
}

.doc-table td:first-child,
.doc-table td:nth-child(2) {
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
}

.doc-table td:last-child {
  color: var(--muted);
}

.doc-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.doc-list li + li {
  margin-top: 6px;
}

.doc .token-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 26px;
  border-radius: 15px;
}

.doc .steps li {
  color: var(--muted);
}
