:root {
  --bg: #0e0b09;
  --surface: #1b1511;
  --tint: #2d1b10;
  --press: #4c2a17;
  --line: #3a2e25;
  --edge: #76634f;
  --fg: #f3e9da;
  --dim: #a08d79;
  --ember: #ec7a3a;
  --gold: #e9b949;
  --jade: #3dbe8f;
  --red: #f2555a;
  --oxblood: #8c2a23;
  --mono: ui-monospace, 'JetBrains Mono', 'Cascadia Mono', 'SF Mono', Menlo, Consolas, 'Noto Sans Mono CJK SC',
    'PingFang SC', 'Microsoft YaHei', monospace;
  --pad: clamp(12px, 2vw, 40px);
  --t-fast: 120ms;
  --t-base: 160ms;
  --t-banner: 200ms;
  --t-flash: 1200ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.45 var(--mono);
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

a {
  color: var(--ember);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a,
button,
.button {
  transition: color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out);
}

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

button,
.button,
input,
select {
  font: inherit;
  color: var(--fg);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 12px;
  background: transparent;
  border: 1px solid var(--ember);
  cursor: pointer;
}

button:hover:not(:disabled),
.button:hover {
  background: var(--tint);
  text-decoration: none;
}

button:active:not(:disabled),
.button:active {
  background: var(--press);
  transition-duration: 0s;
}

[data-copy] {
  transition-duration: var(--t-base);
}

.copied {
  color: var(--jade);
  border-color: var(--jade);
  transition-duration: var(--t-fast);
}

button:disabled,
a.button:not([href]) {
  opacity: 0.4;
  pointer-events: none;
}

a.button[aria-current='true'] {
  background: var(--ember);
  color: var(--bg);
}

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

.is-ok {
  color: var(--jade);
}

.is-warn {
  color: var(--gold);
}

.is-critical {
  color: var(--red);
}

.step h2 span {
  color: var(--ember);
}

.flash {
  animation: flash var(--t-flash) var(--ease-in);
}

@keyframes flash {
  from {
    background-color: var(--tint);
  }
}

.enter {
  animation: enter var(--t-banner) var(--ease-out);
}

@keyframes enter {
  from {
    opacity: 0;
    translate: 0 -4px;
  }
}

nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 48px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 24px;
  flex: 1;
}

.nav-links a {
  padding: 13px 0 11px;
  color: var(--dim);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--fg);
  text-decoration: none;
}

.nav-links a:hover:not([aria-current]) {
  border-bottom-color: var(--line);
}

.nav-links a[aria-current] {
  color: var(--fg);
  border-bottom-color: var(--ember);
}

.nav-actions {
  display: flex;
  gap: 8px;
}

.primary,
.primary:hover {
  background: var(--ember);
  color: var(--bg);
  font-weight: 700;
}

a.primary[aria-current='true'] {
  background: transparent;
  color: var(--fg);
}

.primary.copied {
  background: transparent;
  color: var(--jade);
}

.menu-check {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.menu-check:focus-visible + .nav-toggle {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--fg);
}

.banner {
  padding: 6px var(--pad);
  background: var(--oxblood);
  color: var(--fg);
  font-size: 16px;
}

.page > .banners {
  align-self: stretch;
  margin: 0 calc(var(--pad) * -1);
}

.page > .banners:first-child {
  margin-top: -16px;
}

.banners:empty {
  display: none;
}

main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
  padding: 16px var(--pad);
}

.page-center .ledger {
  margin: 0 auto;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 28px;
}

.hero .range-tabs {
  margin-left: auto;
}

.hero-value {
  color: var(--ember);
  font-size: clamp(44px, 4vw + 20px, 104px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero-value.is-critical {
  color: var(--red);
}

.hero-value.is-dim {
  color: var(--dim);
}

.unit {
  margin-left: 8px;
  color: var(--dim);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
}

.art-hero {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: clamp(150px, 70vh - 340px, 320px);
  margin: -16px calc(var(--pad) * -1) 0;
  padding: 28px max(32px, 7vw);
  background: url(/ui-assets/hero-moon.jpg) 50% 30% / cover no-repeat;
}

.art-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 70%, var(--bg));
}

.art-hero > * {
  position: relative;
}

.art-hero img {
  display: block;
  width: clamp(240px, 30vw, 440px);
  height: auto;
  filter: drop-shadow(0 0 4px var(--bg)) drop-shadow(0 0 2px var(--bg));
}

.art-hero p {
  font-size: clamp(14px, 1.4vw, 20px);
  font-weight: 700;
  text-shadow: 0 0 6px var(--bg), 0 0 2px var(--bg);
}

.stat-card {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.stat-card .label {
  color: var(--dim);
  white-space: nowrap;
}

.kv-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 28px;
}

.kv-row-large {
  font-size: clamp(15px, 0.6vw + 11px, 22px);
}

.ledger {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 12px 36px;
  font-size: clamp(15px, min(1.7vw, 3.2vh), 40px);
}

.ledger .stat-card {
  display: contents;
}

.copy-value {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  min-width: 0;
}

.copy-value .mono {
  word-break: break-all;
}

.copy-value button {
  font-size: 13px;
}

.range-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chart {
  display: none;
  grid-template-columns: max-content minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 4px 6px;
  height: 240px;
  color: var(--dim);
  font-size: 11px;
  line-height: 14px;
}

.chart-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: right;
  white-space: nowrap;
}

.chart-plot {
  width: 100%;
  height: calc(100% - 14px);
  margin: 7px 0;
  overflow: visible;
}

.chart-plot .grid,
.chart-plot .line {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.chart-unit {
  grid-row: 2;
  grid-column: 1;
  text-align: right;
}

.range-radio,
.seg input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

#r-1h:checked ~ .chart-1h,
#r-24h:checked ~ .chart-24h,
#r-7d:checked ~ .chart-7d,
#r-30d:checked ~ .chart-30d {
  display: grid;
}

#r-1h:checked ~ .hero [for='r-1h'],
#r-24h:checked ~ .hero [for='r-24h'],
#r-7d:checked ~ .hero [for='r-7d'],
#r-30d:checked ~ .hero [for='r-30d'],
.seg :checked + .button {
  background: var(--ember);
  color: var(--bg);
}

#r-1h:focus-visible ~ .hero [for='r-1h'],
#r-24h:focus-visible ~ .hero [for='r-24h'],
#r-7d:focus-visible ~ .hero [for='r-7d'],
#r-30d:focus-visible ~ .hero [for='r-30d'],
.seg :focus-visible + .button {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.chart-plot .grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-plot .line {
  stroke: var(--ember);
  stroke-width: 1.5;
}

.chart-plot stop {
  stop-color: var(--ember);
}

.chart-x {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  white-space: nowrap;
}

@media (max-width: 639px) {
  .chart {
    font-size: 10px;
  }

  .chart-x span:nth-child(even),
  .plain :is(th, td):is(:nth-child(3), :nth-child(n + 5)),
  .rates :is(th, td):nth-child(2) {
    display: none;
  }
}

.tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr));
  gap: 16px;
}

.page-center .tables {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
}

.panel h2 {
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: inherit;
  font-weight: 400;
}

.panel h2 a::after {
  content: ' ›' / '';
}

.plain {
  border: 0;
}

.plain h2 {
  border: 0;
  color: var(--fg);
}

.plain .table-scroll {
  overflow: visible;
}

.plain td {
  white-space: normal;
}

.rates {
  font-size: 14px;
}

.rates tbody tr {
  cursor: pointer;
}

.rates tbody tr:hover {
  background: var(--tint);
}

.table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 6px 12px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--surface);
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  color: var(--dim);
  font-weight: 400;
  border-bottom-color: var(--line);
}

.table-empty {
  color: var(--dim);
}

.history {
  display: grid;
  grid-template-columns: max-content minmax(504px, 1fr);
  gap: 4px 12px;
  padding: 12px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.history > span {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg);
}

.history div {
  display: flex;
  color: var(--line);
  mask: repeating-linear-gradient(90deg, #000 0 calc(100% / 168 - 1px), #0000 0 calc(100% / 168));
}

.history i {
  background: currentColor;
}

.history p {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 11px;
}

.endpoints {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.endpoints .mono {
  width: min(40ch, 100%);
}

.endpoints p:nth-child(4) {
  margin-top: 12px;
}

.page-status .tables {
  align-items: start;
}

[aria-sort='ascending'] a::after {
  content: ' ↑' / '';
}

[aria-sort='descending'] a::after {
  content: ' ↓' / '';
}

.bar {
  width: 100%;
  min-width: 64px;
  background: linear-gradient(var(--surface), var(--surface)) center / 100% 6px no-repeat;
}

.bar span {
  display: block;
  height: 6px;
  background: var(--ember);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  color: var(--dim);
}

.more {
  display: inline;
  margin-left: 4px;
}

.more[open] {
  display: block;
}

.more summary {
  display: inline;
  color: var(--ember);
  cursor: pointer;
  list-style: none;
}

.more a {
  display: block;
}

.lookup {
  display: flex;
  gap: 8px;
}

.lookup input,
.connect input {
  min-height: 36px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--edge);
}

.lookup input {
  flex: 1;
  min-width: 0;
}

::placeholder {
  color: var(--dim);
  opacity: 1;
}

.lookup input:focus,
.connect input:focus {
  border-color: var(--ember);
}

.page-connect {
  font-size: 16px;
}

.page-connect > :not(.banners) {
  flex: none;
  width: min(100%, 760px);
  margin-inline: auto;
}

.connect {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step {
  gap: 12px;
  padding-bottom: 12px;
}

.step > :not(h2) {
  margin-inline: 12px;
}

.step p,
.earn {
  color: var(--dim);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.step-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.step-row .primary {
  margin-left: auto;
}

.field {
  display: flex;
  flex: 4 1 20em;
  flex-direction: column;
  gap: 4px;
  color: var(--dim);
}

.worker {
  flex: 1 1 8em;
}

.sha,
.field .label {
  font-size: 13px;
}

.seg {
  position: relative;
  display: flex;
}

.seg label + label {
  margin-left: -1px;
}

.connect:has([value='linux']:checked) .os-windows,
.connect:has([value='windows']:checked) .os-linux {
  display: none;
}

.command {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.command code {
  flex: 1 1 20em;
  min-width: 0;
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

var {
  color: var(--dim);
  font-style: normal;
}

var::before {
  content: '<';
}

var::after {
  content: '>';
}

.earn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  padding: 0 12px;
}

.earn input {
  width: 7em;
}

.earn .value {
  color: var(--fg);
}

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

.raw summary {
  padding: 6px 12px;
  cursor: pointer;
}

.note {
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  color: var(--dim);
}

.others {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 8px 24px;
  padding: 12px;
}

.others .stat-card {
  display: contents;
}

.news-line {
  align-self: flex-start;
}

.page-news {
  gap: 28px;
}

.news {
  max-width: 72ch;
}

.news h2 {
  font-size: 18px;
  font-weight: 400;
}

.news time {
  margin-right: 8px;
  color: var(--dim);
}

.news p {
  margin-top: 6px;
}

@media (min-width: 900px) and (min-height: 560px) {
  body {
    height: 100dvh;
  }

  main {
    overflow: auto;
  }

  .page-fill .chart {
    flex: 1 1 0;
    height: auto;
    min-height: 140px;
  }

  .page-fill .tables {
    flex: 1 1 0;
    min-height: 160px;
    grid-auto-rows: minmax(0, 1fr);
  }
}

@media (max-width: 1023px) {
  nav {
    gap: 16px;
  }

  .nav-links {
    gap: 12px;
  }
}

@media (max-width: 899px) {
  nav {
    justify-content: space-between;
    gap: 8px;
  }

  .nav-toggle {
    display: inline-flex;
    order: 2;
    align-items: stretch;
    padding: 0 8px;
  }

  .nav-actions {
    order: 1;
    margin-left: auto;
  }

  .nav-actions .button {
    min-height: 40px;
    padding: 0 6px;
    white-space: nowrap;
  }

  .brand .wordmark {
    width: auto;
    height: 13px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 5;
    flex-direction: column;
    gap: 0;
    padding: 4px var(--pad) 8px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }

  .menu-check:checked ~ .nav-links {
    display: flex;
    animation: enter var(--t-base) var(--ease-out);
  }

  .nav-links a {
    padding: 12px 0;
    border-bottom: 0;
  }

  .nav-links a[aria-current] {
    color: var(--ember);
  }

  .hero .range-tabs {
    margin-left: 0;
  }

  .art-hero {
    justify-content: flex-end;
    min-height: calc(56.25vw + 64px);
    padding-top: 0;
    padding-bottom: 16px;
    background-image: url(/ui-assets/hero-moon-960.jpg);
    background-position: top;
    background-size: 100% auto;
  }

  .art-hero::before {
    background: linear-gradient(to bottom, transparent calc(56.25vw - 120px), var(--bg) calc(56.25vw + 4px));
  }

  .panel .table-scroll {
    max-height: 420px;
  }

  .page-center .ledger {
    margin: 0;
  }

  .stat-card {
    flex-wrap: wrap;
  }

  .ledger {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .ledger .label {
    margin-top: 12px;
    font-size: 13px;
  }

  button,
  .button,
  .lookup input,
  .connect input {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation: none !important;
    transition: none !important;
  }
}
