/* NOVAI Explorer - vanilla CSS. Dark only.
 *
 * Inherits the design tokens of website/src/index.css so the explorer feels
 * native to novai.network. No Tailwind, no @apply, no build step.
 */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: hsl(228 30% 4%);
  --bg-deep: hsl(228 40% 6%);
  --fg: hsl(210 40% 96%);
  --muted: hsl(215 20% 55%);
  --primary: hsl(228 100% 62%);
  --primary-soft: hsla(228 100% 62% / 0.08);
  --accent: hsl(192 95% 68%);
  --accent-soft: hsla(192 95% 68% / 0.15);
  --card-bg: hsla(228 28% 8% / 0.5);
  --card-border: hsla(224 20% 25% / 0.25);
  --row-border: hsla(224 20% 25% / 0.2);
  --border: hsla(224 20% 25% / 0.5);
  --destructive: hsl(0 84% 60%);

  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --gap: 1rem;
  --gap-lg: 1.5rem;
  --container: 1280px;

  --font-display: 'Space Grotesk', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

  --grad-text: linear-gradient(90deg, hsl(228 100% 70%) 0%, hsl(192 95% 68%) 50%, hsl(270 80% 75%) 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, hsla(228 100% 62% / 0.06), transparent),
    radial-gradient(ellipse 60% 40% at 80% 20%, hsla(192 95% 68% / 0.04), transparent),
    radial-gradient(ellipse 50% 60% at 60% 80%, hsla(270 80% 65% / 0.03), transparent);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  color: var(--fg);
}
h1 { font-size: 1.625rem; line-height: 1.2; }
h2 { font-size: 1.05rem; }
h3 { font-size: 1rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 2px solid hsla(228 100% 62% / 0.7);
  outline-offset: 3px;
  border-radius: 4px;
}

.gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =====================================================================
   Header
   ===================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: hsla(228 30% 4% / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-nav {
  max-width: var(--container);
  margin-inline: auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
}
.brand:hover { text-decoration: none; }
.brand img {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.brand-name {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.search {
  flex: 1 1 360px;
  min-width: 220px;
  position: relative;
  display: flex;
}
.search input {
  width: 100%;
  background: hsla(224 28% 10% / 0.6);
  border: 1px solid hsla(224 20% 25% / 0.6);
  border-radius: var(--radius-sm);
  color: var(--fg);
  padding: 0.55rem 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.search input::placeholder {
  color: hsla(215 20% 55% / 0.7);
  font-family: var(--font-body);
}
.search input:focus {
  border-color: hsla(228 100% 62% / 0.5);
  background: hsla(224 28% 12% / 0.75);
}
.search-status {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  font-size: 0.75rem;
  color: var(--muted);
  pointer-events: none;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.nav-link {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover {
  color: var(--fg);
  text-decoration: none;
  background: var(--primary-soft);
}

/* =====================================================================
   Main content
   ===================================================================== */

main {
  flex: 1;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
}

.hero { padding-top: 0.25rem; }
.hero-title {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.hero-sub {
  color: var(--muted);
  margin: 0;
  max-width: 60ch;
}

/* =====================================================================
   Stat grid
   ===================================================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--gap);
}
.stat {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1rem 1.25rem;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.15;
}
.stat-label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 0.35rem;
}

/* =====================================================================
   Card
   ===================================================================== */

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1.25rem 1.5rem;
}
.card-title {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

/* =====================================================================
   Two-column (entity page)
   ===================================================================== */

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-lg);
}
.two-col-right {
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
}
@media (min-width: 820px) {
  .two-col { grid-template-columns: 1.15fr 1fr; }
}

/* =====================================================================
   Key/value table
   ===================================================================== */

.kv {
  width: 100%;
  border-collapse: collapse;
}
.kv th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  width: 11rem;
  padding: 0.5rem 1rem 0.5rem 0;
  font-size: 0.85rem;
  vertical-align: top;
  border-bottom: 1px solid var(--row-border);
}
.kv td {
  padding: 0.5rem 0;
  vertical-align: top;
  border-bottom: 1px solid var(--row-border);
  word-break: break-word;
}
.kv tr:last-child th,
.kv tr:last-child td { border-bottom: none; }

/* =====================================================================
   Data table
   ===================================================================== */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.data-table thead th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  padding: 0.55rem 1rem 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.data-table tbody td {
  padding: 0.6rem 1rem 0.6rem 0;
  border-bottom: 1px solid var(--row-border);
}
.data-table tbody tr:hover {
  background: hsla(228 100% 62% / 0.04);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .num { font-variant-numeric: tabular-nums; }

/* =====================================================================
   Hash / num / copy
   ===================================================================== */

.hash,
.hash-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0;
}
.hash { color: var(--muted); }
.hash-link { color: var(--accent); }
.num { font-variant-numeric: tabular-nums; }
.hash-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.copy-btn {
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  border: 1px solid hsla(224 20% 25% / 0.5);
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  line-height: 1.3;
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover {
  color: var(--fg);
  border-color: hsla(228 100% 62% / 0.5);
}
.copy-btn.copied {
  color: hsl(150 60% 60%);
  border-color: hsla(150 60% 60% / 0.6);
  background: hsla(150 60% 60% / 0.08);
}

/* =====================================================================
   Buttons
   ===================================================================== */

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid hsla(224 20% 25% / 0.6);
  color: var(--fg);
  font-size: 0.85rem;
  font-weight: 500;
}
.btn-ghost:hover {
  border-color: hsla(228 100% 62% / 0.5);
  background: var(--primary-soft);
  text-decoration: none;
}

/* =====================================================================
   Pills
   ===================================================================== */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.18rem 0.7rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border: 1px solid var(--border);
  font-family: var(--font-body);
}
.pill-good {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: hsla(192 95% 68% / 0.3);
}
.pill-bad {
  color: hsl(0 84% 72%);
  background: hsla(0 84% 60% / 0.12);
  border-color: hsla(0 84% 60% / 0.3);
}

/* =====================================================================
   Notes, errors, misc
   ===================================================================== */

.note {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0.7rem 0.95rem;
  background: hsla(224 28% 10% / 0.4);
  border-left: 3px solid hsla(192 95% 68% / 0.45);
  border-radius: 6px;
}

.limitations {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.error-box {
  color: hsl(0 84% 72%);
  background: hsla(0 84% 60% / 0.06);
  border: 1px solid hsla(0 84% 60% / 0.3);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.block-nav { display: flex; gap: 0.5rem; }
.entity-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.entity-meta { margin: 0.5rem 0 0; }

.raw-json {
  margin: 0;
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  white-space: pre;
  overflow: auto;
  background: var(--bg-deep);
  color: var(--fg);
}

/* =====================================================================
   Footer
   ===================================================================== */

.site-footer {
  margin-top: 2.5rem;
  padding: 1.75rem 1.5rem;
  border-top: 1px solid var(--border);
  background: hsla(228 30% 4% / 0.5);
}
.site-footer-inner {
  max-width: var(--container);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--muted);
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--fg); }

/* =====================================================================
   Mobile
   ===================================================================== */

@media (max-width: 640px) {
  .site-nav { padding: 0.625rem 1rem; gap: 0.75rem; }
  main { padding: 1.5rem 1rem 2.5rem; }
  .hero-title { font-size: 1.75rem; }
  .stat-value { font-size: 1.25rem; }
  .kv th { width: auto; min-width: 7rem; padding-right: 0.75rem; }
  .data-table { font-size: 0.78rem; }
  .data-table thead th,
  .data-table tbody td { padding-right: 0.6rem; }
  .brand-sub { display: none; }
}
