@font-face {
  font-family: "Inter Display";
  src: url("/fonts/inter-display/InterDisplay-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("/fonts/inter-display/InterDisplay-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("/fonts/inter-display/InterDisplay-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Inter Display";
  src: url("/fonts/inter-display/InterDisplay-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif/InstrumentSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --blue: #0142fe;
  --blue-hover: #0035cc;
  --bg: #080808;
  --card: #121212;
  --elevated: #1b1b1d;
  --text: #fcfcfc;
  --muted: rgba(255, 255, 255, 0.7);
  --line: rgba(255, 255, 255, 0.12);
  --danger: #ef4444;
  --header-h: 72px;
  --radius: 12px;
  --focus: 0 0 0 3px rgba(1, 66, 254, 0.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter Display", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--blue);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 80;
}
.skip-link:focus { top: 12px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(8, 8, 8, 0.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  margin-right: auto;
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}
.top-nav {
  display: none;
  gap: 24px;
}
.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.top-nav a[aria-current="page"],
.top-nav a:hover { color: #fff; }

.btn {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 16px; }
.btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

main { max-width: 1080px; margin: 0 auto; padding: 48px 20px 80px; }

.hero { max-width: 640px; padding: 48px 0 24px; }
.eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--muted);
}
h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1.1;
  font-weight: 500;
}
.lede { margin: 0 0 32px; color: var(--muted); max-width: 520px; }
.hint { margin: 16px 0 0; color: var(--muted); font-size: 14px; min-height: 1.5em; }

.dashboard { display: flex; flex-direction: column; gap: 24px; }
.account-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-end;
}
.account-card h2 {
  margin: 4px 0 8px;
  font-size: 22px;
  word-break: break-all;
  font-weight: 500;
}
.meta { margin: 0; color: var(--muted); font-size: 14px; }
.account-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}
.panel h3 { margin: 0 0 8px; font-size: 18px; }
.panel p { margin: 0; color: var(--muted); font-size: 14px; }

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal-root[hidden] { display: none; }
.scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.64);
}
.modal {
  position: relative;
  width: min(440px, 100%);
  background: #111;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.modal-head h2 { margin: 0; font-size: 20px; }
.icon-btn {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 8px;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.modal-copy { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.wallet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(58vh, 480px);
  overflow-y: auto;
}
.wallet-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
  padding: 2px;
}
.wallet-list button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--elevated);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.wallet-list button:hover { border-color: var(--blue); background: #16181f; }
.wallet-list button:focus-visible { outline: none; box-shadow: var(--focus); }
.wallet-list button:disabled { opacity: 0.55; cursor: not-allowed; }
.wallet-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.wallet-list small { margin-left: auto; color: var(--muted); font-weight: 500; }
.error { margin: 12px 0 0; color: #fca5a5; font-size: 14px; }
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #1b1b1d;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  z-index: 50;
}

@media (min-width: 768px) {
  .topbar { padding: 0 32px; }
  .top-nav { display: flex; }
  main { padding: 72px 32px 120px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .wallet-list button { transition: none; }
}
