/* ORIN Chain — Shared Design System
   The AI-Native Blockchain
   Colors: Deep Space + Neural Cyan + Synapse Purple
*/

/* ── CSS Variables ── */
:root {
  --bg-deep: #0a0e17;
  --bg-card: #101827;
  --bg-hover: #1e293b;
  --bg-input: #0f172a;
  --border: #334155;
  --border-light: #475569;
  --text-primary: #E5EEF8;
  --text-secondary: #94a3b8;
  --text-muted: #8FA4BF;
  --accent-cyan: #22d3ee;
  --accent-purple: #a78bfa;
  --accent-green: #4ade80;
  --accent-red: #f87171;
  --accent-yellow: #fbbf24;
  --gradient-primary: linear-gradient(135deg, #22d3ee, #a78bfa);
  --gradient-card: linear-gradient(145deg, #101827, #1e293b);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(34, 211, 238, 0.15);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --transition: 0.2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

a { color: var(--accent-cyan); text-decoration: none; transition: var(--transition); }
a:hover { color: #67e8f9; }

/* ── Typography ── */
h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.75rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }

.text-cyan { color: var(--accent-cyan); }
.text-purple { color: var(--accent-purple); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-yellow { color: var(--accent-yellow); }
.text-muted { color: var(--text-secondary); }
.text-mono { font-family: var(--font-mono); }
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.container-lg { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { align-items: center; justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* ── Card ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-glow:hover { box-shadow: var(--shadow-glow); }

/* ── Button ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.btn:hover { transform: scale(1.02); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--gradient-primary);
  color: #000;
}
.btn-primary:hover { box-shadow: 0 0 20px rgba(34, 211, 238, 0.3); }

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
}
.btn-secondary:hover { background: rgba(34, 211, 238, 0.1); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-hover); }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn-full { width: 100%; }

/* ── Input ── */
.input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font-sans);
  outline: none;
  width: 100%;
  transition: var(--transition);
}
.input:focus { border-color: var(--accent-cyan); box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.15); }
.input-mono { font-family: var(--font-mono); }

/* ── Badge ── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-cyan { background: rgba(34, 211, 238, 0.15); color: var(--accent-cyan); }
.badge-purple { background: rgba(167, 139, 250, 0.15); color: var(--accent-purple); }
.badge-green { background: rgba(74, 222, 128, 0.15); color: var(--accent-green); }
.badge-red { background: rgba(248, 113, 113, 0.15); color: var(--accent-red); }
.badge-yellow { background: rgba(251, 191, 36, 0.15); color: var(--accent-yellow); }

/* ── Stat Card ── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Table ── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.table tr:hover td { background: rgba(30, 41, 59, 0.5); }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab {
  padding: 12px 20px;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  font-weight: 500;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent-cyan); border-bottom-color: var(--accent-cyan); }

/* ── Toast ── */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 10000; }
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  margin-top: 8px;
  font-size: 0.9rem;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}
.toast-success { border-left: 3px solid var(--accent-green); }
.toast-error { border-left: 3px solid var(--accent-red); }
.toast-info { border-left: 3px solid var(--accent-cyan); }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Code ── */
.code-block {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-x: auto;
  line-height: 1.5;
}
.code-inline {
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ── Section ── */
.section { padding: 80px 0; }
.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}
.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 48px;
}

/* ── Animations ── */
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade { animation: fadeIn 0.5s ease forwards; }
.animate-pulse { animation: pulse 2s infinite; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── Responsive ── */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 48px 0; }
  .card { padding: 16px; }
  .btn-lg { padding: 12px 24px; font-size: 1rem; }
  .hide-mobile { display: none; }
}
@media (max-width: 480px) {
  .container { padding: 0 12px; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; }
  .tab { white-space: nowrap; padding: 10px 14px; font-size: 0.85rem; }
}

/* ── Page Content (below nav) ── */
.page-content { padding-top: 72px; min-height: calc(100vh - 72px); }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 80px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--accent-cyan); }
.footer-links { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
