/* The ledger: panels over the hero video, blurred until a wallet is connected. */

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ledger-page {
  min-height: 100svh;
  background-color: #000;
}

.ledger-video {
  position: fixed;
  opacity: 0.42;
}

.ledger-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, #000000d9 0%, #00000099 38%, #000000e6 100%);
  pointer-events: none;
}

.nav-link.is-current {
  background-color: #ffffff1a;
  color: #fff;
}

.nav-address {
  display: none;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background-color: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

@media (min-width: 1024px) {
  .nav-address:not([hidden]) {
    display: block;
  }
}

/* ---------------------------------------------------------------------------------------------
   Page
   --------------------------------------------------------------------------------------------- */

.ledger {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 7.5rem 1.25rem 5rem;
}

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

.ledger-lede {
  margin-top: 1.25rem;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.625;
  letter-spacing: 0.01em;
}

.book {
  position: relative;
  margin-top: 3.25rem;
}

.book-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  transition: filter 0.6s ease, opacity 0.6s ease;
}

.book[data-locked="true"] .book-body {
  filter: blur(10px);
  opacity: 0.62;
  pointer-events: none;
  user-select: none;
}

.panel {
  min-width: 0;
  padding: clamp(1.5rem, 3.2vw, 2.5rem);
  border-radius: 1.75rem;
  background-color: #0c0c0ce6;
  box-shadow: inset 0 0 0 1px var(--line);
}

.panel-title {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  text-transform: lowercase;
}

/* The public counter */

.counters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
}

.counter + .counter {
  padding-left: 2rem;
  border-left: 1px solid var(--line);
}

.label {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.value {
  margin-top: 0.75rem;
  font-size: clamp(2.5rem, 6.4vw, 4.75rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.value i {
  color: #ffffff73;
  font-style: normal;
}

.value small {
  margin-left: 0.6rem;
  color: var(--dim);
  font-size: 0.875rem;
  letter-spacing: 0;
}

.value.is-tick {
  animation: value-tick 0.6s var(--out) both;
}

@keyframes value-tick {
  from {
    opacity: 0.35;
    transform: translateY(-0.12em);
  }
}

.sub {
  margin-top: 0.85rem;
  color: var(--soft);
  font-size: 0.9375rem;
}

.rule-host {
  position: relative;
  margin-top: 2.5rem;
}

.rule-host .rule-scroll {
  margin-top: 0;
}

.rule .mark.is-dot {
  transform: scaleY(0.05);
}

.rule .mark {
  transition: opacity 0.5s ease, transform 0.56s cubic-bezier(0.45, 0, 0.15, 1);
}

.rule-unset {
  position: absolute;
  top: 38%;
  left: 50%;
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  background-color: #000;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.8125rem;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  margin-top: 1.5rem;
  color: var(--dim);
  font-size: 0.8125rem;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lg {
  display: block;
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background-color: #fff;
}

.lg-dot {
  height: 3px;
  opacity: 0.45;
}

.lg-head {
  background-image: var(--grad);
}

/* Treasury statement and swap box */

.columns {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1rem;
}

.statement {
  margin-top: 0.75rem;
}

.statement > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.35rem 0;
}

.statement > div + div {
  border-top: 1px solid var(--line);
}

.statement dt {
  font-size: 1.0625rem;
}

.statement dt span,
.statement dd span {
  display: block;
  margin-top: 0.3rem;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

.statement dd {
  text-align: right;
}

.statement dd b {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.swap-sides {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.3rem;
  border-radius: 9999px;
  background-color: #000;
  box-shadow: inset 0 0 0 1px var(--line);
}

.swap-sides button {
  padding: 0.4rem 1.2rem;
  border-radius: 9999px;
  color: #fffc;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.swap-sides button.is-active {
  background-color: #fff;
  color: #000;
}

.swap-field {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 1.25rem;
  background-color: #000;
  box-shadow: inset 0 0 0 1px var(--line);
}

.swap-sides + .swap-field {
  margin-top: 1.25rem;
}

.swap-field span {
  flex: none;
  width: 6.5rem;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.swap-field input,
.swap-field output {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.swap-field em {
  flex: none;
  width: 2.6rem;
  color: var(--soft);
  font-size: 0.875rem;
  font-style: normal;
}

.swap-field:focus-within {
  box-shadow: inset 0 0 0 1px #ffffff66;
}

.swap-fee,
.swap-effect {
  margin-top: 1rem;
  color: var(--soft);
  font-size: 0.875rem;
  line-height: 1.55;
}

.swap-fee {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.swap-button {
  width: 100%;
  margin-top: 1.25rem;
  padding: 0.8rem 0;
  border-radius: 9999px;
  background-color: #fff;
  color: #000;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.25rem;
}

.swap-button:disabled {
  background-color: #ffffff1f;
  color: #ffffff8c;
  cursor: default;
}

/* Renewals */

.journal-scroll {
  margin-top: 0.75rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.journal-scroll::-webkit-scrollbar {
  display: none;
}

.journal {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.journal th {
  padding: 0.75rem 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 400;
  text-align: left;
  text-transform: lowercase;
}

.journal td {
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
  color: #ffffffe6;
  font-size: 0.9375rem;
}

.journal th:last-child,
.journal td:last-child {
  text-align: right;
}

.journal td:nth-child(3) {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.journal tr.is-new td {
  animation: row-in 0.6s var(--out) both;
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.journal-empty {
  max-width: 34rem;
  margin-top: 1rem;
  color: var(--soft);
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------------------------
   The gate, and what replaces it once a wallet is connected
   --------------------------------------------------------------------------------------------- */

.gate-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 0 6rem;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.gate-layer.is-leaving {
  opacity: 0;
}

.gate {
  position: sticky;
  top: max(6rem, 22svh);
  width: min(27rem, 100%);
  padding: 2.25rem 2rem 1.75rem;
  border-radius: 1.75rem;
  background-color: #0c0c0c;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 40px 120px #000;
  text-align: center;
  pointer-events: auto;
}

.gate-star,
.notice-star {
  filter: drop-shadow(0 0 16px #7a55e0a6);
}

.gate-star {
  display: block;
  margin: 0 auto 1.25rem;
  animation: star-turn 16s linear infinite;
}

@keyframes star-turn {
  to {
    transform: rotate(360deg);
  }
}

.gate h2 {
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.gate-text {
  margin-top: 0.85rem;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.gate-wallets {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.gate-wallets:empty {
  display: none;
}

.wallet-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  background-color: #fff;
  color: #000;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5rem;
  text-align: left;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wallet-row img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.wallet-row svg {
  margin-left: auto;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wallet-row:hover {
  opacity: 0.85;
}

.wallet-row:hover svg {
  transform: translateX(0.125rem);
}

.wallet-row[aria-busy="true"] {
  opacity: 0.55;
  cursor: progress;
}

.gate-none {
  margin-top: 1.5rem;
  padding: 0.9rem 1.1rem;
  border-radius: 1.25rem;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--soft);
  font-size: 0.875rem;
  line-height: 1.55;
}

.gate-foot {
  margin-top: 1.5rem;
  color: #ffffff80;
  font-size: 0.75rem;
  line-height: 1.6;
}

.notice {
  display: flex;
  gap: 1.5rem;
  max-width: 46rem;
  margin: 3rem auto 0;
  padding: 1.75rem 2rem;
  border-radius: 1.75rem;
  background-color: #0c0c0cf2;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  animation: notice-in 0.6s var(--out) both;
}

@keyframes notice-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.notice-star {
  flex: none;
  margin-top: 0.15rem;
}

.notice h2 {
  font-size: 1.375rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.notice p {
  margin-top: 0.6rem;
  color: var(--soft);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.pill {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pill-white {
  background-color: #fff;
  color: #000;
}

.pill-white:hover {
  opacity: 0.8;
}

.pill-ghost {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  color: #fffc;
}

.pill-ghost:hover {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  color: #fff;
}

.notice + .book {
  margin-top: 1.5rem;
}

.footer-slim {
  position: relative;
  z-index: 2;
  background-color: transparent;
}

@media (min-width: 640px) {
  .ledger {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

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

@media (max-width: 639px) {
  .ledger {
    padding-top: 6.25rem;
  }

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

  .counter + .counter {
    padding-top: 2rem;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .panel {
    border-radius: 1.5rem;
  }

  .notice {
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
  }

  .statement > div {
    gap: 1rem;
  }

  .statement dd b {
    font-size: 1.25rem;
  }

  .swap-field span {
    width: 5.25rem;
  }

  .gate {
    padding: 2rem 1.25rem 1.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-body,
  .gate-layer,
  .swap-sides button,
  .wallet-row,
  .wallet-row svg,
  .pill,
  .rule .mark {
    transition: none;
  }

  .gate-star,
  .notice,
  .value.is-tick,
  .journal tr.is-new td {
    animation: none;
  }
}
