/* Dark Web Info — Noir Dossier Theme */

:root {
  --bg: #07070d;
  --bg-2: #0b0b15;
  --panel: #10101d;
  --panel-2: #141426;
  --line: #23233c;
  --line-bright: #35355c;
  --ink: #eceaf8;
  --dim: #9693b8;
  --faint: #63607f;
  --violet: #a78bfa;
  --violet-soft: #c4b5fd;
  --violet-dim: #6d5fc4;
  --cyan: #67e8f9;
  --pink: #f472b6;
  --online: #34d399;
  --offline: #64748b;
  --warn: #fbbf24;
  --danger: #fb7185;
  --font: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(167, 139, 250, 0.08), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(103, 232, 249, 0.04), transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
}

::selection { background: var(--violet-dim); color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-bright); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--violet-dim); }

/* ============ SIDEBAR ============ */
.side {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 250px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 900;
  padding: 1.75rem 1.25rem;
}

.side-logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  margin-bottom: 2.5rem;
  padding: 0 0.4rem;
}

.side-logo .mark {
  width: 38px;
  height: 38px;
  border: 1px solid var(--violet-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--violet);
  background: radial-gradient(circle at 35% 35%, rgba(167, 139, 250, 0.18), transparent 70%);
  position: relative;
}

.side-logo .mark::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 50%;
}

.side-logo .name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.side-logo .name small {
  display: block;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
  margin-top: 0.15rem;
}

.side-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  color: var(--dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.22s;
  position: relative;
}

.side-nav a .idx {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--faint);
  width: 1.4rem;
  transition: color 0.22s;
}

.side-nav a:hover {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

.side-nav a:hover .idx { color: var(--violet); }

.side-nav a.active {
  color: var(--violet-soft);
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.25);
}

.side-nav a.active .idx { color: var(--violet); }

.side-nav a.active::before {
  content: '';
  position: absolute;
  left: -1.25rem;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--violet);
  border-radius: 0 3px 3px 0;
}

.side-foot {
  border-top: 1px solid var(--line);
  padding-top: 1.1rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--faint);
  letter-spacing: 0.08em;
  line-height: 1.9;
}

.side-foot .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--online);
  margin-right: 0.4rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============ PAGE WRAPPER ============ */
.page {
  margin-left: 250px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(7, 7, 13, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar .crumb {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
}

.topbar .crumb b {
  color: var(--violet);
  font-weight: 600;
}

.menu-btn {
  display: none;
  background: var(--panel);
  border: 1px solid var(--line-bright);
  color: var(--ink);
  width: 40px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.05rem;
  cursor: pointer;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 2rem;
}

.page-body {
  padding: 2.5rem 0 4rem;
  min-height: 60vh;
}

/* ============ HERO ============ */
.hero {
  padding: 3.5rem 0 3rem;
  text-align: center;
  position: relative;
}

.hero .kicker {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}

.hero .kicker::before,
.hero .kicker::after {
  content: '';
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan));
}

.hero .kicker::after {
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.hero h1 {
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: 1.4rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--violet-soft);
  position: relative;
}

.hero h1 em::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 0.14em;
  background: rgba(167, 139, 250, 0.4);
}

.hero p.lede {
  color: var(--dim);
  font-size: 1.08rem;
  max-width: 640px;
  margin: 0 auto 2rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  max-width: 640px;
  margin: 0 auto;
  background: var(--panel);
}

.hero-stats .stat {
  flex: 1;
  padding: 1.1rem 0.5rem;
  border-right: 1px solid var(--line);
}

.hero-stats .stat:last-child { border-right: none; }

.hero-stats .stat b {
  display: block;
  font-family: var(--mono);
  font-size: 1.4rem;
  color: var(--violet-soft);
  font-weight: 700;
}

.hero-stats .stat span {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ============ SECTIONS ============ */
section { padding: 2.75rem 0; }

.sec-head {
  margin-bottom: 2rem;
}

.sec-head .num {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  color: var(--violet);
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.6rem;
}

.sec-head h2 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.sec-head p {
  color: var(--dim);
  margin-top: 0.7rem;
  max-width: 700px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.22s;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font);
}

.btn-primary {
  background: linear-gradient(135deg, var(--violet) 0%, var(--violet-dim) 100%);
  color: #fff;
  box-shadow: 0 6px 24px rgba(167, 139, 250, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(167, 139, 250, 0.4);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--dim);
  border-color: var(--line-bright);
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--violet-dim);
  background: var(--panel);
}

.btn-cyan {
  background: transparent;
  color: var(--cyan);
  border-color: rgba(103, 232, 249, 0.35);
}

.btn-cyan:hover {
  background: rgba(103, 232, 249, 0.08);
  border-color: var(--cyan);
}

/* ============ MARKET DIRECTORY ROWS ============ */
.dir {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
}

.dir-row {
  display: grid;
  grid-template-columns: 42px 1.4fr 1fr 110px auto;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}

.dir-row:last-child { border-bottom: none; }
.dir-row:hover { background: var(--panel-2); }

.dir-row .num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
}

.dir-row .mname {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.dir-row .mname small {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--dim);
  margin-top: 0.15rem;
}

.dir-row .focus {
  font-size: 0.82rem;
  color: var(--dim);
}

.dir-row .focus b {
  color: var(--violet-soft);
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill.online {
  color: var(--online);
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.08);
}

.pill.online::before { animation: pulse 2s ease-in-out infinite; }

.pill.offline {
  color: var(--offline);
  border-color: rgba(100, 116, 139, 0.4);
  background: rgba(100, 116, 139, 0.08);
}

.pill.offline::before { background: var(--offline); }

.dir-row .acts {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.mini-btn {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line-bright);
  background: transparent;
  color: var(--dim);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.mini-btn:hover {
  color: var(--violet-soft);
  border-color: var(--violet-dim);
  background: rgba(167, 139, 250, 0.08);
}

/* Market detail cards (markets page) */
.mcard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.mcard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  opacity: 0;
  transition: opacity 0.25s;
}

.mcard:hover {
  border-color: var(--line-bright);
  transform: translateY(-3px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
}

.mcard:hover::before { opacity: 1; }

.mcard .mhead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.mcard h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

.mcard .badge-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.tag-chip {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.12);
  color: var(--violet-soft);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

.mcard p { color: var(--dim); font-size: 0.92rem; }
.mcard p + p { margin-top: 0.7rem; }

.onion-list {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.onion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
}

.onion-item code {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--cyan);
  word-break: break-all;
  flex: 1;
}

/* ============ CONTENT BLOCKS ============ */
.prose h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 2.2rem 0 0.9rem;
  letter-spacing: -0.01em;
}

.prose h3 {
  font-size: 1.15rem;
  margin: 1.6rem 0 0.6rem;
  color: var(--violet-soft);
}

.prose p { color: var(--dim); margin-bottom: 1rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem 1.3rem; color: var(--dim); }
.prose li { margin-bottom: 0.5rem; }
.prose li::marker { color: var(--violet); }
.prose strong { color: var(--ink); }
.prose a { color: var(--cyan); }
.prose code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  color: var(--violet-soft);
}
.prose blockquote {
  border-left: 3px solid var(--violet-dim);
  padding: 0.3rem 0 0.3rem 1.1rem;
  margin: 1.2rem 0;
  color: var(--dim);
  font-style: italic;
}

.buy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.buy-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.3rem;
  transition: border-color 0.25s;
}

.buy-item:hover { border-color: var(--line-bright); }

.buy-item .ico { font-size: 1.5rem; margin-bottom: 0.6rem; }
.buy-item h4 { font-size: 0.98rem; margin-bottom: 0.4rem; color: var(--ink); }
.buy-item p { font-size: 0.84rem; color: var(--dim); margin: 0; }

/* Guide index cards */
.ggrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
}

.gcard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: all 0.25s;
  position: relative;
}

.gcard::after {
  content: '→';
  position: absolute;
  top: 1.2rem;
  right: 1.3rem;
  color: var(--faint);
  font-family: var(--mono);
  transition: all 0.25s;
}

.gcard:hover {
  border-color: var(--violet-dim);
  transform: translateY(-3px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.4);
}

.gcard:hover::after {
  color: var(--violet);
  transform: translateX(4px);
}

.gcard .gnum {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}

.gcard h3 { font-size: 1.05rem; margin-bottom: 0.5rem; line-height: 1.35; }
.gcard p { font-size: 0.84rem; color: var(--dim); margin: 0; }

/* Meta / misc */
.meta {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 2rem;
}

.note {
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  color: var(--dim);
  font-size: 0.9rem;
  margin: 1.5rem 0;
}

.note b { color: var(--warn); }

/* Footer */
footer {
  border-top: 1px solid var(--line);
  padding: 2rem;
  text-align: center;
}

footer .f-grid {
  max-width: 1080px;
  margin: 0 auto 1.5rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

footer .f-grid a {
  color: var(--dim);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

footer .f-grid a:hover { color: var(--violet-soft); }

footer .copy {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: var(--faint);
  text-transform: uppercase;
}

/* Back to top */
#toTop {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-bright);
  background: var(--panel);
  color: var(--violet-soft);
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
  z-index: 950;
  transition: all 0.25s;
}

#toTop:hover {
  border-color: var(--violet);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.3);
}

/* Fade-in */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .side {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: none;
  }

  .side.open {
    transform: translateX(0);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6);
  }

  .page { margin-left: 0; }

  .menu-btn { display: block; }

  .dir-row {
    grid-template-columns: 1fr;
    grid-template-areas:
      "num"
      "name"
      "focus"
      "acts";
    row-gap: 0.6rem;
  }

  .dir-row .num { grid-area: num; }
  .dir-row .acts { grid-area: acts; }
  .dir-row .mname { grid-area: name; }
  .dir-row .focus { grid-area: focus; }

  main { padding: 0 1.25rem; }
  .topbar { padding: 0.8rem 1.25rem; }
}
