/* Element defaults and shared primitives. */

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/*
 * The user-agent rule for [hidden] is `display: none`, which any author rule
 * that sets `display` outranks — a class like `.wallet-info { display: flex }`
 * silently defeats the attribute and the element stays on screen. Everything
 * in this app toggles visibility through `hidden`, so it is enforced here.
 */
[hidden] {
  display: none !important;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.4vw, 38px);
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}

button {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.12s ease, transform 0.05s ease;
  white-space: nowrap;
}

button:active {
  transform: translateY(1px);
}

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

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
}

:root[data-theme="dark"] .btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary {
    background: var(--accent);
    color: var(--accent-contrast);
  }
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.15);
}

.btn-primary:disabled {
  background: var(--line-strong);
  color: var(--ink-faint);
  cursor: not-allowed;
  filter: none;
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
  padding: 9px 16px;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-inset);
}

.btn-secondary:disabled {
  color: var(--ink-faint);
  border-color: var(--line);
  cursor: not-allowed;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12.5px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.addr-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
