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

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface-hover: #1a1a24;
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --text: #e4e4e7;
  --text-dim: #71717a;
  --text-muted: #52525b;
  --accent: #a78bfa;
  --accent-dim: rgba(167, 139, 250, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 60px 20px 80px;
}

/* ── Container ─────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 140px);
}

/* ── Services ──────────────────────────────────────────────────────── */
.services {
  flex: 1;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── Service Card ──────────────────────────────────────────────────── */
.service-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 24px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  cursor: pointer;
  margin-bottom: 10px;
}

.service-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.service-card:active {
  transform: translateY(0);
}

.service-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  font-size: 1.3rem;
  color: var(--accent);
}

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

.service-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.service-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.service-arrow {
  flex-shrink: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
}

.service-card:hover .service-arrow {
  color: var(--accent);
  transform: translateX(3px);
}


/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  body {
    padding: 32px 14px 60px;
  }

  .service-card {
    padding: 16px;
  }
}

/* ── Utilities ─────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Page Content (About, Contact, etc.) ───────────────────────────── */
.page-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  line-height: 1.6;
}
.page-content.narrow {
  max-width: 600px;
}
.page-content h1 {
  margin-bottom: 24px;
  font-size: 2.5rem;
  color: var(--text);
  text-align: center;
}
.page-content p {
  margin-bottom: 20px;
  color: var(--text-dim);
  font-size: 1.125rem;
}
.page-content p.center {
  text-align: center;
}
.highlight {
  color: var(--accent);
  font-weight: 500;
}

/* ── Statistics / Grids ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin: 40px 0;
}
.stat-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  font-family: var(--mono);
}
.stat-label {
  font-size: 0.875rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Banners ───────────────────────────────────────────────────────── */
.collaboration-banner {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.1), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  margin-top: 48px;
}
.collaboration-banner h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--text);
}
.collaboration-banner p {
  margin-bottom: 24px;
  font-size: 1rem;
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #000;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  text-align: center;
}
.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Forms ─────────────────────────────────────────────────────────── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(255, 255, 255, 0.03);
  padding: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}
.form-input, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-textarea {
  resize: vertical;
  min-height: 120px;
}
.form-status {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  display: none;
  font-size: 0.875rem;
}
.form-status.success {
  display: block;
  background: rgba(167, 139, 250, 0.1);
  color: var(--accent);
  border: 1px solid rgba(167, 139, 250, 0.2);
}
.form-status.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── Blog & Articles ───────────────────────────────────────────────── */
.blog-header { margin-bottom: 2rem; }
.blog-title { font-size: 1.5rem; margin-bottom: 0.5rem; font-weight: 700; color: var(--text); }
.blog-desc { color: var(--text-dim); }

.article-list { display: flex; flex-direction: column; gap: 1rem; }
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  display: block;
}
.article-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}
.article-card-title { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.article-card-date { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.article-card-desc { font-size: 0.9rem; color: var(--text-dim); line-height: 1.5; }

.article-header { margin-bottom: 2rem; }
.article-hero-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
}
.article-date { font-size: 0.85rem; color: var(--accent); margin-bottom: 0.5rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.article-title { font-size: 1.8rem; font-weight: 700; color: var(--text); line-height: 1.2; margin-bottom: 1rem; }

.article-content { color: var(--text); line-height: 1.6; font-size: 1rem; }
.article-content h2 { font-size: 1.3rem; font-weight: 600; color: var(--text); margin-top: 2rem; margin-bottom: 1rem; }
.article-content p { margin-bottom: 1.2rem; }
.article-content ul { margin-bottom: 1.2rem; padding-left: 1.5rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-content a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.article-content a:hover { border-bottom-color: var(--accent); }

.back-link { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-dim); text-decoration: none; margin-bottom: 2rem; font-size: 0.9rem; transition: color 0.2s; }
.back-link:hover { color: var(--text); }

/* ── App Header ────────────────────────────────────────────────────── */
.app-header {
  margin-bottom: 24px;
  text-align: center;
}
.header-content {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
}
.app-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-dim, #71717a);
  transition: color 0.2s;
}
.app-brand:hover {
  color: var(--text, #e4e4e7);
}
.app-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.app-name {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── Footer ────────────────────────────────────────────────────────── */
.footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
  text-align: center;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
}
.footer-link {
  color: var(--text-dim, #71717a);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.footer-link:hover {
  color: var(--text, #e4e4e7);
}
.footer-copy {
  font-size: 0.7rem;
  color: var(--text-muted, rgba(255,255,255,0.3));
}

/* ── TX Leader Explorer (Search & Result Card) ─────────────────────── */
.header {
  text-align: center;
  margin-bottom: 40px;
}
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.logo h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.subtitle {
  color: var(--text-dim);
  font-size: 0.87rem;
  font-weight: 400;
}
.search-box {
  margin-bottom: 32px;
}
.input-wrapper {
  display: flex;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  transition: border-color 0.2s;
}
.input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
#tx-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 10px 12px;
  min-width: 0;
}
#tx-input::placeholder {
  color: var(--text-muted);
}
#search-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 22px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
#search-btn:hover {
  opacity: 0.88;
}
#search-btn:active {
  transform: scale(0.97);
}
#search-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-loader {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10, 10, 15, 0.25);
  border-top-color: #0a0a0f;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
.btn-loader.visible { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.error {
  color: var(--error, #f87171);
  background: var(--error-bg, rgba(248, 113, 113, 0.08));
  font-size: 0.82rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  animation: fadeSlideUp 0.35s ease-out;
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-section { padding: 4px 0; }
.section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 14px;
}
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.field { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.value { font-size: 0.9rem; color: var(--text); word-break: break-all; }
.value.mono { font-family: var(--mono); font-size: 0.8rem; }
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fields-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.country-flag { font-size: 1.1rem; margin-right: 6px; }

@media (max-width: 480px) {
  .result-card { padding: 20px; }
  .fields-grid { grid-template-columns: 1fr; gap: 10px; }
  .input-wrapper { flex-direction: column; }
  #search-btn { width: 100%; }
}

/* ── TX Range Explorer ─────────────────────────────────────────────── */
.range-explorer-container { max-width: 720px; }

.range-inputs {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.range-inputs .input-wrapper {
  margin-bottom: 0;
}

.range-inputs .input-wrapper:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.range-inputs .input-wrapper:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
  border-top: none;
}

.range-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--accent);
  z-index: 1;
  background: var(--surface);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.range-arrow:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.range-inputs input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 10px 12px;
  min-width: 0;
}

.range-inputs input::placeholder {
  color: var(--text-muted);
}

.range-search-btn {
  width: 100%;
  margin-top: 12px;
  background: var(--accent);
  color: #0a0a0f;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.range-search-btn:hover { opacity: 0.88; }
.range-search-btn:active { transform: scale(0.98); }
.range-search-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Token pills */
.token-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.token-pill {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(167, 139, 250, 0.15);
  cursor: default;
  transition: background 0.2s;
}

.token-pill:hover {
  background: rgba(167, 139, 250, 0.2);
}

.pool-pill {
  background: rgba(96, 165, 250, 0.1);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.15);
}

.pool-pill:hover {
  background: rgba(96, 165, 250, 0.2);
}

/* Trades */
.trades-header {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 24px 0 12px;
}

.trade-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
  animation: fadeSlideUp 0.25s ease-out;
}

.trade-card:hover {
  border-color: var(--border-hover);
}

.trade-card.trade-failed {
  border-color: rgba(239, 68, 68, 0.2);
}

.trade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.trade-sig {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.trade-sig:hover { opacity: 0.7; }

.trade-time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.trade-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.trade-slot {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.trade-err {
  font-size: 0.72rem;
  color: #ef4444;
  font-weight: 600;
}

.trade-signer {
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.2s;
}

.trade-signer:hover { opacity: 0.7; }

.signer-changes, .pool-changes {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.trade-balances {
  display: flex;
  gap: 16px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.trade-balances > :not(:first-child) {
  border-left: 1px solid var(--border);
  padding-left: 16px;
}

.signer-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  min-width: 32px;
  padding-top: 2px;
}

.token-changes {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.token-change {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.token-mint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.token-delta {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
}

.delta-positive { color: #4ade80; }
.delta-negative { color: #f87171; }
.token-pct { font-size: 0.7rem; opacity: 0.7; }

/* Trade gap (truncation indicator) */
.trade-gap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
}

.gap-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.gap-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-style: italic;
}

.trade-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 32px;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .range-explorer-container { max-width: 100%; }
  .trade-header { flex-direction: column; gap: 4px; align-items: flex-start; }
}
