/* AIdent.store - Styles */

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a28;
  --border: #1e1e2e;
  --text: #e0e0e8;
  --text-dim: #8888a0;
  --text-bright: #ffffff;
  --accent: #7c5cff;
  --accent-glow: rgba(124, 92, 255, 0.3);
  --green: #4ade80;
  --yellow: #fbbf24;
  --red: #f87171;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon {
  font-size: 28px;
  color: var(--accent);
}

.logo-text {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-bright);
}

.logo-dot {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 24px;
}

.nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text-bright);
}

.nav-active {
  color: var(--accent) !important;
}

/* Hero */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.2;
  margin-bottom: 20px;
}

.highlight {
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent-glow);
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-dim);
  margin-bottom: 48px;
}

/* Stats Bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.stat {
  text-align: center;
}

.stat-value {
  display: block;
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-bright);
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Sections */
.section {
  padding: 60px 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 12px;
}

.section-desc {
  color: var(--text-dim);
  margin-bottom: 24px;
}

/* Primitives */
.primitives {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.primitive {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s;
}

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

.primitive-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.primitive h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.primitive p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.primitive pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
}

.primitive code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green);
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  margin-top: 16px;
}

.tab {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--sans);
}

.tab:hover {
  border-color: var(--accent);
  color: var(--text);
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Agent List */
.agent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agent-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  transition: all 0.2s;
  cursor: pointer;
}

.agent-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.agent-rank {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-dim);
  min-width: 32px;
  text-align: center;
}

.agent-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.agent-status-dot.alive {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.agent-status-dot.dormant {
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow);
}

.agent-status-dot.dead {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
}

.agent-info {
  flex: 1;
  min-width: 0;
}

.agent-name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-desc {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-meta {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}

.agent-meta-item {
  text-align: right;
}

.agent-meta-value {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-bright);
}

.agent-meta-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Cemetery specific */
.cemetery-list .agent-card {
  opacity: 0.7;
}

.cemetery-list .agent-card:hover {
  opacity: 1;
}

.agent-epitaph {
  font-style: italic;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Lookup */
.lookup-form {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.lookup-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-bright);
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.lookup-input:focus {
  border-color: var(--accent);
}

.lookup-input::placeholder {
  color: var(--text-dim);
}

.btn {
  padding: 12px 24px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: var(--sans);
}

.btn:hover {
  opacity: 0.9;
}

.lookup-result {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

.lookup-result pre {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Agent Profile Card */
.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.profile-name {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-bright);
}

.profile-status {
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.profile-desc {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-value {
  font-size: 14px;
  color: var(--text-bright);
}

.profile-value.mono {
  font-family: var(--mono);
  font-size: 13px;
}

.profile-meta {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.profile-meta-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 8px;
}

.profile-meta-content {
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.profile-meta-empty {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 14px;
}

.empty {
  text-align: center;
  padding: 40px;
  color: var(--text-dim);
  font-size: 14px;
  font-style: italic;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
  text-align: center;
}

.footer-quote {
  font-size: 18px;
  font-style: italic;
  color: var(--accent);
  margin-bottom: 12px;
}

.footer-copy {
  font-size: 13px;
  color: var(--text-dim);
}

.footer-links {
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-sep {
  color: var(--border);
  margin: 0 8px;
}

/* Article (Whitepaper) */
.article {
  padding: 60px 0 40px;
}

.article-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.25;
  margin-bottom: 12px;
}

.article-meta {
  font-size: 14px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.article-section {
  margin-bottom: 40px;
}

.article-section h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 16px;
  padding-top: 8px;
}

.article-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-bright);
  margin-top: 28px;
  margin-bottom: 12px;
}

.article-section p {
  margin-bottom: 14px;
  line-height: 1.75;
}

.article-section .dim {
  color: var(--text-dim);
}

.article-section .dim a {
  color: var(--accent);
  text-decoration: none;
}

.article-section .dim a:hover {
  text-decoration: underline;
}

.article-section ul,
.article-section ol {
  margin-bottom: 14px;
  padding-left: 24px;
}

.article-section li {
  margin-bottom: 6px;
  line-height: 1.7;
}

.article-section li ul {
  margin-top: 6px;
  margin-bottom: 0;
}

.article-section code {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--accent);
  background: rgba(124, 92, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.article-section pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 14px;
}

.article-section pre code {
  background: none;
  padding: 0;
  color: var(--green);
  font-size: 13px;
}

.article-section blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 24px 0;
  font-size: 20px;
  font-style: italic;
  color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 14px;
}

.article-section table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.article-section th {
  text-align: left;
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  color: var(--text-bright);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-section td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.article-section td code {
  font-size: 13px;
}

.article-conclusion {
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 32px;
  }

  .stats-bar {
    flex-wrap: wrap;
    gap: 20px;
  }

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

  .primitives {
    grid-template-columns: 1fr;
  }

  .nav {
    gap: 16px;
  }

  .nav a {
    font-size: 13px;
  }

  .agent-meta {
    display: none;
  }

  .header {
    flex-direction: column;
    gap: 16px;
  }

  .article-header h1 {
    font-size: 26px;
  }
}
