/* ==========================================================================
   Compute Credit — solid colour, hairline rules, no gradients, no shadows.
   Swiss minimalism with a Playfair display face for the luxury register.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0a0a0b;
  --surface: #101012;
  --well: #0c0c0e;

  --line: #232327;
  --line-2: #2e2e34;

  --gold: #c8a24a;
  --gold-2: #b08c38;
  --gold-ink: #14100a;

  --ink: #f2efe8;
  --ink-2: #a8a39a;
  --ink-3: #7b7770;

  --danger: #e07a63;

  --serif: "Playfair Display", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--gold);
  color: var(--gold-ink);
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--line-2);
}

/* ------------------------------------------------------------------ icons */

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

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

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

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 19px;
  height: 19px;
  color: var(--gold);
}

.brand-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.brand-tag {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--ink-3);
  border: 1px solid var(--line);
  padding: 3px 7px 2px;
  translate: 0 -1px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.status-dot {
  width: 5px;
  height: 5px;
  background: currentColor;
  animation: blink 2.8s var(--ease-out) infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.status[data-tone="ok"] {
  color: var(--gold);
}
.status[data-tone="err"] {
  color: var(--danger);
}

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

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
  transition:
    transform 320ms var(--ease),
    scale 160ms var(--ease-out),
    background-color 240ms ease,
    border-color 240ms ease,
    color 240ms ease,
    opacity 240ms ease;
}

.btn:active {
  scale: 0.98;
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none;
  scale: 1;
}

.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--gold-ink);
  font-weight: 600;
}

.btn-outline {
  border-color: var(--line-2);
  color: var(--ink);
}

.btn .spinner {
  display: none;
  width: 11px;
  height: 11px;
  border: 1.4px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.btn[data-loading="true"] .spinner {
  display: inline-block;
}

.btn[data-loading="true"] .btn-label {
  opacity: 0.6;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (hover: hover) and (pointer: fine) {
  .btn-gold:hover {
    background: var(--gold-2);
    border-color: var(--gold-2);
  }
  .btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
  }
}

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

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px 56px;
  display: grid;
  gap: 32px;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 72px;
  align-items: end;
  padding: 88px 0 60px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 30px;
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold);
}

.eyebrow .rule {
  width: 52px;
  height: 1px;
  background: var(--gold);
}

.balance {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 8.6vw, 112px);
  line-height: 0.88;
  letter-spacing: -0.032em;
  color: var(--ink);
}

.balance .cur {
  font-family: var(--sans);
  font-size: 0.26em;
  font-weight: 400;
  letter-spacing: 0;
  vertical-align: 1.02em;
  margin-right: 0.16em;
  color: var(--gold);
}

.balance .num {
  display: inline-block;
}

.balance-label {
  margin: 18px 0 0;
  font-size: 9.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 34px;
}

.addr {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  cursor: pointer;
  transition:
    border-color 240ms ease,
    color 240ms ease;
}

.addr:disabled {
  cursor: default;
  color: var(--ink-3);
}

.addr-icon {
  width: 12px;
  height: 12px;
}

@media (hover: hover) and (pointer: fine) {
  .addr:not(:disabled):hover {
    border-color: var(--gold);
    color: var(--gold);
  }
}

.hero-note {
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.01em;
}

/* ------------------------------------------------------------------ stats */

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

.hstat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.hstat-k {
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.hstat-v {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.hstat-v.is-loading {
  position: relative;
  color: transparent;
}

.hstat-v.is-loading::after {
  content: "";
  position: absolute;
  inset: 3px 0 3px auto;
  width: 72%;
  background: var(--line-2);
  animation: pulse 1.6s var(--ease-out) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.9;
  }
}

/* ------------------------------------------------------------------ cards */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition: border-color 420ms var(--ease);
}

/* A gold rule that travels across the top edge on hover. */
.card::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: -1px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 760ms var(--ease);
}

.card:hover::before,
.card:focus-within::before {
  transform: scaleX(1);
}

@media (hover: hover) and (pointer: fine) {
  .card:hover {
    border-color: var(--line-2);
  }
}

.card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  color: var(--gold);
  transition:
    border-color 420ms var(--ease),
    transform 520ms var(--ease);
}

.card-icon svg {
  width: 15px;
  height: 15px;
}

.card:hover .card-icon {
  border-color: var(--gold);
  transform: translate(2px, -2px);
}

.card-head h2 {
  margin: 0;
  min-width: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.005em;
}

.hint {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ fields */

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.optional {
  color: var(--ink-3);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 11px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

input {
  width: 100%;
  height: 46px;
  padding: 0 64px 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: var(--well);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none;
  transition:
    border-color 240ms ease,
    background-color 240ms ease;
}

input::placeholder {
  color: var(--ink-3);
}

input:focus {
  outline: none;
  border-color: var(--gold);
  background: #0e0e10;
}

.suffix {
  position: absolute;
  right: 14px;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  pointer-events: none;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.inline-form .input-wrap input {
  padding-right: 14px;
}

.quote {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-top: 2px;
  font-size: 12.5px;
}

.quote-value {
  display: inline-block;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.fine {
  margin: 0 0 22px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

/* Cards are flex columns; keep the calls to action at their natural width
   instead of stretching into a slab across the card. */
.grid .card .btn {
  align-self: flex-start;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  color: var(--gold);
}

/* ------------------------------------------------------------------ messages */

.msg {
  min-height: 18px;
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 240ms var(--ease-out),
    transform 240ms var(--ease-out);
}

.msg:empty {
  opacity: 0;
  transform: translateY(-4px);
}

.msg[data-tone="ok"] {
  color: var(--gold);
}
.msg[data-tone="err"] {
  color: var(--danger);
}

/* ------------------------------------------------------------------ lists */

.list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-2);
  opacity: 1;
  transition: opacity 260ms var(--ease-out);
}

@starting-style {
  .list li {
    opacity: 0;
  }
}

.list .empty {
  justify-content: flex-start;
  color: var(--ink-3);
}

.row-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.row-actions {
  display: inline-flex;
  gap: 8px;
  flex: 0 0 auto;
}

.mini-btn {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    scale 140ms var(--ease-out),
    color 220ms ease,
    border-color 220ms ease;
}

.mini-btn:active {
  scale: 0.96;
}

@media (hover: hover) and (pointer: fine) {
  .mini-btn:hover {
    color: var(--gold);
    border-color: var(--gold);
  }
}

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

footer {
  border-top: 1px solid var(--line);
  padding: 26px max(32px, calc((100% - 1120px) / 2 + 32px)) 72px;
  display: flex;
  align-items: center;
  gap: 30px;
}

footer a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 240ms ease;
}

footer a svg {
  width: 11px;
  height: 11px;
}

/* The contact address is a public-domain mailbox, and BaseScan asks that such
   an address be published on the project's own site before they accept it. */
.footer-mail {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 11.5px;
  color: var(--ink-2);
}

@media (hover: hover) and (pointer: fine) {
  footer a:hover {
    color: var(--gold);
  }
}

.footer-chain {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0.02em;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.muted {
  color: var(--ink-3);
  font-size: 12px;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: max(32px, env(safe-area-inset-bottom));
  z-index: 40;
  padding: 12px 22px;
  border: 1px solid var(--gold);
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition:
    opacity 160ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.toast[data-open="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-duration: 260ms;
}

/* ------------------------------------------------------------------ reveal */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 780ms var(--ease),
    transform 780ms var(--ease);
  transition-delay: var(--d, 0ms);
}

.js [data-reveal][data-reveal-from="top"] {
  transform: translateY(-14px);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

.js .eyebrow .rule {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 900ms var(--ease) 140ms;
}

.js .is-in .eyebrow .rule {
  transform: scaleX(1);
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 56px 0 44px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .header-inner,
  main {
    padding-left: 20px;
    padding-right: 20px;
  }
  .header-inner {
    height: 62px;
  }
  .status,
  .brand-tag {
    display: none;
  }
  .hero {
    padding: 40px 0 36px;
  }
  .hero-meta {
    gap: 12px;
  }
  .hero-note {
    flex: 1 1 100%;
  }
  .card {
    padding: 22px 20px;
  }
  /* the hint drops to its own line instead of forcing the card wider */
  .card-head {
    margin-bottom: 20px;
    grid-template-columns: auto 1fr;
    row-gap: 8px;
  }
  .card-head .hint {
    grid-column: 1 / -1;
    justify-self: start;
    /* align under the title, past the icon box */
    padding-left: 46px;
  }
  .inline-form {
    grid-template-columns: 1fr;
  }
  footer {
    padding: 22px 20px 56px;
    flex-wrap: wrap;
    gap: 18px;
  }
  .footer-chain {
    margin-left: 0;
    width: 100%;
  }
  input {
    font-size: 16px;
  }
}

/* ------------------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .js .eyebrow .rule {
    transform: scaleX(1);
    transition: none;
  }
  .status-dot,
  .btn .spinner {
    animation: none;
  }
  .card::before {
    transition: none;
  }
  .card:hover .card-icon {
    transform: none;
  }
  .btn,
  .btn:active {
    transform: none;
    scale: 1;
  }
  .toast,
  .toast[data-open="true"] {
    transition-duration: 1ms;
  }
}
