/* ---------------------------------------------------------------------------
   $NSF Dashboard — "Mission Control" design system
   Authored directly (no build step). Spec: design.md
--------------------------------------------------------------------------- */

/* Fonts — self-hosted, no third-party requests */
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

/* Tokens */
:root {
  color-scheme: dark;

  --bg: #0a0c10;
  --surface-1: #11141a;
  --surface-2: #181c24;
  --surface-3: #20242e;
  --line: #262b36;
  --line-strong: #39404e;

  --text-primary: #f2f4f8;
  --text-secondary: #a8b0bf;
  --text-tertiary: #67707f;

  --accent: #3ddc84;
  --accent-hover: #5be89a;
  --accent-dim: rgba(61, 220, 132, 0.13);
  --warn: #f5a623;
  --warn-dim: rgba(245, 166, 35, 0.12);
  --danger: #f0506e;
  --danger-dim: rgba(240, 80, 110, 0.1);

  --goggles: linear-gradient(90deg, #ff4d4d 0%, #ffb84d 25%, #4de07c 50%, #4da6ff 75%, #b84dff 100%);

  --r-s: 6px;
  --r-m: 10px;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --font-prose: "Inter", system-ui, -apple-system, sans-serif;

  --dur: 160ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--font-prose);
  font-size: 16px;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

:is(a, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-s);
}

::selection {
  background: rgba(61, 220, 132, 0.25);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-s);
  color: var(--text-primary);
  font-size: 14px;
  text-decoration: none;
  transform: translateY(-64px);
}

.skip-link:focus-visible {
  transform: none;
}

/* Shared type voices */
.eyebrow {
  margin-bottom: 8px;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-transform: uppercase;
}

.label {
  display: block;
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-transform: uppercase;
}

.mono-s {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

h2 {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.prose-link {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color var(--dur) var(--ease);
}

.prose-link:hover {
  text-decoration-color: var(--accent);
}

/* Goggle-gradient strip: brand-gradient use 1 of 2 */
.goggle-strip {
  height: 3px;
  background: var(--goggles);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 12, 16, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-s);
  image-rendering: pixelated;
}

.brand-name {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.brand-sub {
  color: var(--text-tertiary);
  font-size: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Status pill */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.status-pill[data-state="live"] {
  background: var(--accent-dim);
}

.status-pill[data-state="live"] .status-dot {
  background: var(--accent);
  animation: pulse 2.4s var(--ease) infinite;
}

.status-pill[data-state="stale"] {
  background: var(--warn-dim);
}

.status-pill[data-state="stale"] .status-dot {
  background: var(--warn);
}

.status-pill[data-state="offline"] {
  background: var(--danger-dim);
}

.status-pill[data-state="offline"] .status-dot {
  background: var(--danger);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-s);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: #08110b;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--text-primary);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-s {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: var(--r-s);
  color: var(--text-tertiary);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text-primary);
}

.icon-btn svg {
  width: 14px;
  height: 14px;
}

.icon-btn.is-copied {
  color: var(--accent);
}

.icon-btn.is-failed {
  color: var(--danger);
}

/* Hero */
.hero {
  padding-top: 96px;
}

.hero-title {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.07;
}

/* Ticker underline: brand-gradient use 2 of 2 */
.ticker {
  position: relative;
  display: inline-block;
}

.ticker::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 4px;
  border-radius: 2px;
  background: var(--goggles);
}

.hero-thesis {
  max-width: 560px;
  margin-top: 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* Stat bar */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: 40px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  overflow: hidden;
}

.stat-cell {
  background: var(--surface-1);
  padding: 20px;
  min-width: 0;
}

.stat-value {
  display: block;
  margin-top: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat-value.stat-price {
  font-size: 34px;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--accent);
}

.stat-meta {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-tertiary);
}

/* Address wells share the Locked row, filling the columns beside it. */
.stat-cell-wells {
  grid-column: 2 / -1;
  display: flex;
  align-items: center;
}

.stat-cell-wells .wells {
  width: 100%;
  margin-top: 0;
}

.wells {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.well {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-s);
  transition: border-color var(--dur) var(--ease);
}

.well.is-copied {
  border-color: var(--accent);
}

.well .label {
  flex: 0 0 110px;
}

.well-address {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* Sections */
.section {
  margin-top: 64px;
}

.section-head {
  margin-bottom: 24px;
}

.panel {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}

/* Alerts */
.alert {
  padding: 16px;
  border-radius: var(--r-s);
  font-size: 14px;
  line-height: 1.55;
}

.alert-danger {
  border: 1px solid var(--danger);
  background: var(--danger-dim);
}

.alert-danger strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-primary);
  font-weight: 600;
}

.alert-info {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-secondary);
}

.alert-info strong {
  color: var(--text-primary);
  font-weight: 600;
}

.hero .alert {
  margin-top: 16px;
}

/* Scarcity badge (X group chat) */
.scarcity-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border: 1px solid var(--warn);
  border-radius: 999px;
  background: var(--warn-dim);
  color: var(--warn);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.scarcity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 3px var(--warn-dim);
}

.xchat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.xchat-head .eyebrow {
  margin: 0;
}

/* Markets rail */
.rail {
  overflow: hidden;
}

.rail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background-color var(--dur) var(--ease);
}

.rail-row:last-child {
  border-bottom: 0;
}

.rail-row:hover {
  background: var(--surface-2);
}

.rail-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  filter: grayscale(1) opacity(0.7);
  transition: filter var(--dur) var(--ease);
}

.rail-row:hover .rail-icon {
  filter: none;
}

.rail-name {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.rail-dest {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-tertiary);
}

.rail-dest svg {
  width: 12px;
  height: 12px;
}

.rail-row:hover .rail-dest svg {
  color: var(--text-primary);
}

.utility-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.utility-line a {
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}

.utility-line a:hover {
  text-decoration-color: var(--accent);
}

/* Two-up cards */
.two-up {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr 1fr;
}

.card {
  padding: 32px;
}

.card h2 {
  margin-bottom: 16px;
}

.card p + p {
  margin-top: 12px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.card .alert {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.alert-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--danger);
}

/* Fact list (About card) */
.fact-list {
  display: grid;
  margin-top: 24px;
}

.fact-list > div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.fact-list dt {
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fact-list dd {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Transparency strip */
.strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}

.strip-title {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.strip-caption {
  margin-top: 4px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.strip-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}

.strip-stat {
  min-width: 0;
}

.strip-stat .stat-value {
  margin-top: 6px;
  font-size: 20px;
}

/* Holders section */
.holders-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.holders-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--text-tertiary);
}

.caption {
  margin-bottom: 20px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* Table */
.table-wrap {
  overflow: auto;
  max-height: 640px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
  background: var(--surface-1);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 16px;
  background: var(--surface-2);
  color: var(--text-tertiary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

tbody tr {
  transition: background-color var(--dur) var(--ease);
}

tbody tr:hover {
  background: var(--surface-2);
}

tbody tr:last-child td {
  border-bottom: 0;
}

th.num,
td.num {
  text-align: right;
}

.cell-rank {
  width: 56px;
  color: var(--text-tertiary);
  text-align: right;
}

.cell-wallet {
  max-width: 320px;
  white-space: nowrap;
}

.cell-wallet a {
  text-decoration: none;
  color: var(--text-secondary);
}

.cell-wallet a:hover {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cell-wallet .icon-btn {
  width: 24px;
  height: 24px;
  margin-left: 6px;
  vertical-align: middle;
  opacity: 0;
}

tbody tr:hover .cell-wallet .icon-btn,
.cell-wallet .icon-btn:focus-visible,
.cell-wallet .icon-btn.is-copied {
  opacity: 1;
}

.pct {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.pct-bar {
  width: 48px;
  height: 3px;
  flex: 0 0 auto;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}

.pct-bar span {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.6;
}

/* Flag chips */
.flag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.flag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--warn-dim);
  color: var(--warn);
  font-family: var(--font-prose);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Warnings */
.warning-list {
  display: grid;
  gap: 8px;
  margin-top: 64px;
  padding: 16px;
  border: 1px solid var(--danger);
  border-radius: var(--r-s);
  background: var(--danger-dim);
  font-size: 14px;
}

/* Footer */
.site-footer {
  margin-top: 64px;
  padding: 40px 0 48px;
  border-top: 1px solid var(--line);
}

.footnote {
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.support-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding-bottom: 32px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.support-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.support-lead {
  max-width: 420px;
  color: var(--text-secondary);
  font-size: 15px;
}

.support-well {
  width: auto;
  max-width: 100%;
  margin-top: 4px;
  padding: 8px 8px 8px 16px;
  gap: 12px;
  border-color: var(--accent);
}

.support-well .well-address {
  flex: 0 1 auto;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
}

/* Skeleton loading */
.skel {
  color: transparent !important;
  background: var(--surface-3);
  border-radius: 4px;
  animation: shimmer 1.6s var(--ease) infinite;
  -webkit-user-select: none;
  user-select: none;
}

span.skel,
strong.skel {
  display: inline-block;
  min-width: 96px;
  max-width: 100%;
}

.skel-block {
  display: inline-block;
  height: 13px;
  border-radius: 4px;
  background: var(--surface-3);
  animation: shimmer 1.6s var(--ease) infinite;
}

@keyframes shimmer {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.45;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .status-pill[data-state="live"] .status-dot,
  .skel,
  .skel-block {
    animation: none;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}

/* Responsive */
@media (max-width: 900px) {
  .two-up {
    grid-template-columns: 1fr;
  }

  .strip {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding-top: 48px;
  }

  .hero-title {
    font-size: 36px;
  }

  h2 {
    font-size: 24px;
  }

  .section,
  .warning-list,
  .site-footer {
    margin-top: 40px;
  }

  .stat-bar {
    grid-template-columns: 1fr 1fr;
  }

  .stat-cell-locked,
  .stat-cell-wells {
    grid-column: 1 / -1;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-value.stat-price {
    font-size: 22px;
  }

  .brand-sub,
  .pill-meta {
    display: none;
  }

  .card {
    padding: 24px;
  }

  .well .label {
    flex-basis: 84px;
  }

  table {
    min-width: 560px;
  }

  .cell-wallet {
    max-width: 200px;
  }
}
