/* ============================================================
   DarkMarkets — main.css
   Dark intelligence/research terminal aesthetic
   Mobile-first, single dark theme
   ============================================================ */

/* ── Tokens ── */
:root {
  --bg:        #050810;
  --surface:   #0d1117;
  --surface2:  #111827;
  --border:    #1a2030;
  --accent:    #00d4ff;
  --accent-dim:#005f73;
  --text:      #e8eaf0;
  --sub:       #6b7896;
  --green:     #00e676;
  --red:       #ff4444;
  --yellow:    #ffd600;
  --radius-card: 8px;
  --radius-badge: 4px;
  --radius-btn:   6px;
  --header-h: 60px;
  --container: 1140px;
  --gap: 1.5rem;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
code, .mono { font-family: 'JetBrains Mono', 'Courier New', monospace; }

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── Typography ── */
h1, h2, h3, h4, h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}
h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h4 { font-size: 1.1rem; }
p { color: var(--text); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-btn);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover {
  background: #33ddff;
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover {
  background: rgba(0,212,255,0.08);
  text-decoration: none;
}
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-badge);
  font-size: 0.72rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-online  { background: rgba(0,230,118,0.12); color: var(--green); border: 1px solid rgba(0,230,118,0.25); }
.badge-offline { background: rgba(255,68,68,0.12);  color: var(--red);   border: 1px solid rgba(255,68,68,0.25); }
.badge-accent  { background: rgba(0,212,255,0.1);   color: var(--accent);border: 1px solid rgba(0,212,255,0.2); }
.pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.3); }
}

/* ── Header / Nav ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(5,8,16,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}
.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: 0.05em;
  text-decoration: none;
}
.nav-logo span { color: var(--accent); }
.nav-logo:hover { text-decoration: none; }

/* hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 110;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* mobile nav */
.nav-menu {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: calc(100vh - var(--header-h));
  background: rgb(5,8,16);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  z-index: 999;
  border-top: 1px solid var(--border);
}
.nav-menu.open { display: flex !important; }
.nav-link {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  color: var(--sub);
  transition: color 0.2s;
}
.nav-link:hover, .nav-link.active { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--accent); }
.nav-cta { font-size: 0.875rem; }

/* desktop nav */
@media (min-width: 1024px) {
  .nav-toggle { display: none !important; }
  .nav-menu {
    display: flex !important;
    position: static;
    height: auto;
    background: none;
    flex-direction: row;
    align-items: center;
    gap: 0.15rem;
    border: none;
  }
  .nav-link {
    font-size: 0.85rem;
    padding: 0.35rem 0.65rem;
  }
  .nav-cta {
    margin-left: 0.4rem;
    font-size: 0.8rem;
  }
}

/* ── Hero ── */
.hero {
  padding: 5rem 0 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(0,212,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid rgba(0,212,255,0.25);
  border-radius: var(--radius-badge);
}
.hero h1 { margin-bottom: 1rem; }
.hero h1 span { color: var(--accent); }
.hero-sub {
  color: var(--sub);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto 2rem;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}
.hero-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--accent);
  display: block;
}
.hero-stat-label {
  font-size: 0.78rem;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Section common ── */
.section { padding: 3.5rem 0; }
.section-header { margin-bottom: 2rem; }
.section-header h2 { margin-bottom: 0.5rem; }
.section-header p { color: var(--sub); }
.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: block;
  margin-bottom: 0.5rem;
}

/* ── Market Cards Grid ── */
.markets-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
@media (min-width: 600px) {
  .markets-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .markets-grid { grid-template-columns: repeat(3, 1fr); }
}

.market-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.market-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,212,255,0.08);
  border-color: rgba(0,212,255,0.3);
}
.market-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.market-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}
.market-card-meta {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}
.market-card-desc { color: var(--sub); font-size: 0.9rem; flex: 1; }
.market-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

/* Stars (legacy) */
.stars { color: var(--yellow); font-size: 0.85rem; letter-spacing: 0.05em; }
.stars span { color: var(--sub); font-size: 0.8rem; margin-left: 0.25rem; }

/* ── Rating block ── */
.rating {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0;
}
.rating-val {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  color: var(--yellow);
  line-height: 1;
  min-width: 2.8rem;
}
.rating-stars-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.rating-stars {
  color: var(--yellow);
  font-size: 1rem;
  letter-spacing: 0.12em;
  line-height: 1;
}
.rating-count {
  font-size: 0.7rem;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'Space Grotesk', sans-serif;
}

/* ── Recommended badge ── */
.badge-recommend {
  background: rgba(255,214,0,0.12);
  color: var(--yellow);
  border: 1px solid rgba(255,214,0,0.3);
}

/* ── Featured market card ── */
.market-card-featured {
  border-color: rgba(255,214,0,0.25);
  box-shadow: 0 0 0 1px rgba(255,214,0,0.08);
}
.market-card-featured:hover {
  border-color: rgba(255,214,0,0.45);
  box-shadow: 0 12px 40px rgba(255,214,0,0.08);
}

/* ── Feature SVG Icons ── */
.feature-icon-svg-wrap {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: rgba(0,212,255,0.07);
  border: 1px solid rgba(0,212,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--accent);
  flex-shrink: 0;
}
.feature-icon-svg {
  width: 24px;
  height: 24px;
}

/* Score bar */
.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.score-bar-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 2px;
  width: 0;
  transition: width 1s ease 0.3s;
}
.score-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--sub);
  min-width: 2.5rem;
  text-align: right;
}

/* ── Comparison Table ── */
.table-wrap { overflow-x: auto; }
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 640px;
}
.cmp-table th, .cmp-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.cmp-table th {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--sub);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--surface);
  white-space: nowrap;
}
.cmp-table tr:hover td { background: rgba(255,255,255,0.02); }
.cmp-table td:first-child {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--text);
}
.check { color: var(--green); font-size: 1rem; }
.cross { color: var(--red);   font-size: 1rem; }

/* ── Detail Page ── */
.detail-hero {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}
.detail-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 768px) {
  .detail-hero-inner {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}
.detail-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.detail-title { margin-bottom: 0.75rem; }
.detail-desc  { color: var(--sub); max-width: 580px; }

.detail-scores {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  min-width: 260px;
  flex-shrink: 0;
}
.detail-score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}
.detail-score-row:last-child { border-bottom: none; }
.detail-score-label {
  font-size: 0.82rem;
  color: var(--sub);
  font-family: 'Space Grotesk', sans-serif;
}
.detail-score-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent);
}

/* ── Onion Address Display ── */
.onion-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.onion-box-label {
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.onion-address {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--accent);
  word-break: break-all;
  user-select: all;
  display: block;
  padding: 0.75rem 1rem;
  background: rgba(0,212,255,0.04);
  border: 1px solid rgba(0,212,255,0.12);
  border-radius: var(--radius-badge);
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.4rem 0.9rem;
  background: rgba(0,212,255,0.1);
  color: var(--accent);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: var(--radius-btn);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover { background: rgba(0,212,255,0.18); }
.copy-btn.copied { background: rgba(0,230,118,0.15); color: var(--green); border-color: rgba(0,230,118,0.3); }

/* ── Steps / Guide ── */
.steps-list { display: flex; flex-direction: column; gap: 1.25rem; }
.step {
  display: flex;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
}
.step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 6px;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-content h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.step-content p  { color: var(--sub); font-size: 0.9rem; }

/* ── Info Cards / Feature Grid ── */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
}
@media (min-width: 600px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
}
.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}
.feature-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.feature-card p  { color: var(--sub); font-size: 0.875rem; }

/* ── Tips / Warning boxes ── */
.tip-box {
  background: rgba(0,212,255,0.05);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.tip-box p { font-size: 0.875rem; color: var(--sub); }
.tip-box strong { color: var(--text); }

.warn-box {
  background: rgba(255,68,68,0.05);
  border-left: 3px solid var(--red);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.warn-box p { font-size: 0.875rem; color: var(--sub); }

/* ── Reveal animation ── */
.reveal {
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.reveal-hidden {
  opacity: 0;
  transform: translateY(20px);
}
.reveal.reveal-hidden.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Separator ── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Page Header (inner pages) ── */
.page-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.page-header .badge { margin-bottom: 0.75rem; }
.page-header h1 { margin-bottom: 0.75rem; }
.page-header p { color: var(--sub); max-width: 640px; }

/* ── Footer ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (min-width: 600px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  display: block;
}
.footer-logo span { color: var(--accent); }
.footer-tagline { color: var(--sub); font-size: 0.875rem; max-width: 280px; }
.footer-nav h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sub);
  margin-bottom: 0.75rem;
}
.footer-nav ul { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-nav a { color: var(--sub); font-size: 0.875rem; transition: color 0.2s; }
.footer-nav a:hover { color: var(--text); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-bottom p { font-size: 0.8rem; color: var(--sub); }
.footer-disclaimer { font-size: 0.75rem !important; opacity: 0.7; }

/* ── 404 ── */
.error-page {
  min-height: calc(100vh - var(--header-h) - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1rem;
}
.error-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 700;
  color: var(--accent);
  opacity: 0.2;
  line-height: 1;
  display: block;
}
.error-page h1 { margin-bottom: 1rem; }
.error-page p { color: var(--sub); margin-bottom: 1.5rem; }

/* ── About page ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 768px) { .about-grid { grid-template-columns: 2fr 1fr; } }
.about-content h2 { margin-top: 2rem; margin-bottom: 0.75rem; }
.about-content p  { color: var(--sub); margin-bottom: 1rem; }
.about-sidebar .feature-card + .feature-card { margin-top: var(--gap); }

/* ── Utility ── */
.text-accent { color: var(--accent); }
.text-sub    { color: var(--sub); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-sm { gap: 0.5rem; }
.flex   { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }

@media (max-width: 599px) {
  .hide-mobile { display: none; }
}
