/* darknet-guide.com — Dark Codex / Strict Editorial Knowledge Terminal
   Charcoal base · Platinum text · Hairline gold accent · Steel links
   Three-tier voice: Newsreader serif / Inter sans / IBM Plex Mono
   Zero border-radius everywhere. No glow, gradient, or scanlines.
   Motion: draw-in rules, gliding TOC marker, one-time reveals only. */

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

/* ── Custom properties ──────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --rail-wash:     #0B0C0E;
  --canvas:        #0E0F12;
  --article:       #141519;
  --furniture:     #191B20;
  --deep-tint:     #1F2127;

  /* Text (platinum ramp) */
  --platinum:      #EDEEF0;
  --body-plat:     #C4C7CD;
  --muted:         #8A8F98;
  --ghost:         #5A5F68;

  /* Gold accent — hairline structural only */
  --gold-deep:     #8A6D2F;
  --gold:          #B8923F;
  --gold-bright:   #D4B45E;
  --gold-pale:     #E8D28A;

  /* Steel links — cool, distinct from gold */
  --link:          #7FA8C4;
  --link-hover:    #A0C4DC;
  --link-visited:  #6B7E96;
  --link-missing:  #B4785A;

  /* Borders */
  --hairline:      #2A2D34;
  --border:        #363A42;
  --section-rule:  #22252B;

  /* Notice tints */
  --note-bg:    rgba(184,146,63,0.08);
  --info-bg:    rgba(127,168,196,0.08);
  --caution-bg: rgba(180,120,90,0.08);
  --verified-bg:rgba(90,140,110,0.08);

  /* Type */
  --serif: 'Newsreader', 'Spectral', Georgia, serif;
  --sans:  'Inter', -apple-system, 'Segoe UI', sans-serif;
  --mono:  'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace;
}

/* ── Base ───────────────────────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--canvas);
  color: var(--body-plat);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.75;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(127,168,196,0.30);
  transition: color 150ms ease, border-color 150ms ease;
}
a:hover { color: var(--link-hover); border-bottom-color: var(--link-hover); }
a:visited { color: var(--link-visited); }
.link-missing { color: var(--link-missing); border-bottom-color: rgba(180,120,90,0.30); }
.ext::after {
  content: " ↗";
  font-size: 9px;
  color: var(--ghost);
  vertical-align: super;
}
strong { font-weight: 600; color: var(--platinum); }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--gold); color: var(--canvas); padding: 0.4em 0.8em;
  font-family: var(--mono); font-size: 12px;
}
.skip-link:focus { left: 0; }

/* ── Top bar ────────────────────────────────────────────────────────── */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14,15,18,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  padding: 11px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.top-bar-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  border-bottom: none;
  flex-shrink: 0;
}
.top-bar-brand:hover { border-bottom: none; }
.brand-mark {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--platinum);
  letter-spacing: -0.01em;
  position: relative;
}
.brand-mark::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 1px;
  width: 0;
  background: var(--gold);
  animation: ruleDraw 700ms cubic-bezier(0.16,1,0.3,1) 300ms forwards;
}
.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ghost);
}
.top-bar-search {
  flex: 1;
  max-width: 380px;
  margin-left: auto;
}
.top-bar-search input {
  width: 100%;
  background: var(--furniture);
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: 7px 12px 7px 28px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--platinum);
  outline: none;
  transition: border-color 200ms ease;
  position: relative;
}
.search-wrap {
  position: relative;
}
.search-prefix {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ghost);
  pointer-events: none;
}
.top-bar-search input:focus {
  border-color: var(--gold);
}
.top-bar-tools {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}
.top-bar-tools a {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: none;
}
.top-bar-tools a:hover { color: var(--platinum); border-bottom: none; }
.bar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--hairline);
  color: var(--muted);
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}
.bar-toggle:hover { color: var(--platinum); border-color: var(--gold); }

/* ── Three-zone layout ──────────────────────────────────────────────── */
.codex-body {
  display: flex;
  align-items: flex-start;
  max-width: 1220px;
  margin: 0 auto;
}

/* ── Left rail ──────────────────────────────────────────────────────── */
.left-rail {
  width: 208px;
  flex-shrink: 0;
  background: var(--rail-wash);
  border-right: 1px solid var(--hairline);
  min-height: calc(100vh - 48px);
  padding: 20px 12px 28px;
}
.rail-group { margin-bottom: 22px; }
.rail-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ghost);
  margin-bottom: 6px;
  padding-left: 8px;
}
.rail-link {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--link);
  line-height: 2;
  display: block;
  padding: 2px 8px;
  position: relative;
  border-bottom: none;
  transition: color 150ms ease, padding-left 200ms ease;
}
.rail-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 14px;
  background: var(--gold);
  transition: width 150ms ease;
}
.rail-link:hover { color: var(--link-hover); padding-left: 14px; border-bottom: none; }
.rail-link:hover::before { width: 2px; }
.rail-link.active { color: var(--platinum); font-weight: 600; }
.rail-link.active::before { width: 2px; }
.rail-divider {
  height: 1px;
  background: var(--hairline);
  margin: 14px 0;
}
/* Sticky TOC inside rail */
.rail-toc {
  position: sticky;
  top: 56px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.rail-toc-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ghost);
  margin-bottom: 8px;
  padding-left: 12px;
}
.toc-entries { list-style: none; }
.toc-entry {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 2;
  padding-left: 12px;
  border-left: 1px solid var(--hairline);
  transition: color 200ms ease, border-color 200ms ease, border-left-width 100ms ease;
}
.toc-entry a {
  color: var(--muted);
  border-bottom: none;
  display: block;
}
.toc-entry a:hover { color: var(--body-plat); border-bottom: none; }
.toc-entry.toc-active {
  color: var(--platinum);
  border-left: 2px solid var(--gold);
}
.toc-entry.toc-active a { color: var(--platinum); }

/* ── Article column ─────────────────────────────────────────────────── */
.article-col {
  flex: 1;
  background: var(--article);
  padding: 28px 36px 48px;
  min-width: 0;
}

/* Article title */
.article-title {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--platinum);
  padding-bottom: 10px;
  margin-bottom: 16px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.article-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 1px;
  width: 0;
  background: var(--gold);
  animation: ruleDraw 700ms cubic-bezier(0.16,1,0.3,1) 100ms forwards;
}

/* Hatnote */
.hatnote {
  font-family: var(--sans);
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  margin-left: 24px;
  margin-bottom: 14px;
  border-left: 2px solid var(--gold-deep);
  padding-left: 10px;
}

/* Lead paragraph */
.lead-para { margin-bottom: 1em; max-width: 44em; }
.subject-term { font-weight: 600; color: var(--platinum); }

/* H2 sections */
.article-section { margin-top: 36px; }
.section-heading {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--platinum);
  border-bottom: 1px solid var(--section-rule);
  padding-bottom: 6px;
  margin-bottom: 14px;
  position: relative;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.section-heading.revealed {
  opacity: 1;
  transform: translateY(0);
}
.section-num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--gold);
  margin-right: 10px;
  font-weight: 400;
}
.section-heading::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 1px;
  width: 0;
  background: var(--gold);
  transition: width 500ms ease-out;
}
.section-heading.revealed::after { width: 40px; }

/* H3 */
.article-col h3 {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--platinum);
  margin-top: 24px;
  margin-bottom: 8px;
}

/* H4 */
.article-col h4 {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 18px;
  margin-bottom: 6px;
}

/* Body prose */
.article-col p { max-width: 44em; margin-bottom: 1em; }

/* In-article figures — operator captures, square geometry */
.codex-figure {
  margin: 18px 0 24px;
  border: 1px solid var(--border);
  background: var(--furniture);
  max-width: 44em;
}
.codex-figure img {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(0.82) brightness(0.94);
}
.codex-figure figcaption {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 8px 10px;
  border-top: 1px solid var(--hairline);
}

.exhibit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
  margin: 18px 0 24px;
  max-width: 44em;
}
.exhibit-cell {
  display: block;
  background: var(--furniture);
  border: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  text-decoration: none;
  transition: border-color 150ms ease;
}
.exhibit-cell:hover {
  border-color: var(--gold);
  color: var(--link-hover);
}
.exhibit-cell img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  object-position: top center;
  display: block;
  filter: saturate(0.8) brightness(0.92);
}
.exhibit-cell span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--link);
  padding: 6px 8px;
}
.article-col ul, .article-col ol {
  max-width: 44em;
  padding-left: 1.4em;
  margin-bottom: 1em;
}
.article-col li { margin-bottom: 0.25em; }

/* ── Infobox ─────────────────────────────────────────────────────────── */
.infobox {
  float: right;
  width: 288px;
  background: var(--furniture);
  border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  margin: 0 0 20px 28px;
  overflow: hidden;
  animation: cardRise 500ms cubic-bezier(0.16,1,0.3,1) both;
}
.infobox-title-bar {
  background: var(--deep-tint);
  text-align: center;
  font-family: var(--serif);
  font-size: 15px;
  color: var(--platinum);
  padding: 12px;
  border-bottom: 1px solid var(--hairline);
}
.infobox-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: saturate(0.92) brightness(1.05);
}
.infobox-img--shot { object-position: top center; }
.infobox-img-caption {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  padding: 5px 10px 8px;
  border-bottom: 1px solid var(--hairline);
}
.infobox-row {
  display: grid;
  grid-template-columns: 42% 58%;
  border-top: 1px solid var(--hairline);
}
.infobox-label {
  background: var(--furniture);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
  vertical-align: top;
}
.infobox-value {
  background: var(--article);
  color: var(--body-plat);
  padding: 8px 10px;
  font-size: 13px;
}
.infobox-value code {
  font-family: var(--mono);
  font-size: 11px;
  word-break: break-all;
  color: var(--muted);
}

/* ── Onion apparatus ─────────────────────────────────────────────────── */
.onion-table-wrap {
  margin: 18px 0 24px;
  max-width: 44em;
}
.onion-table-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.onion-row {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--hairline);
  border-top: none;
  background: var(--furniture);
  align-items: stretch;
}
.onion-row:first-of-type { border-top: 1px solid var(--hairline); }
.onion-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: var(--canvas);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  min-height: 36px;
}
.onion-str {
  font-family: var(--mono);
  font-size: clamp(10px, 1.4vw, 13px);
  color: var(--platinum);
  word-break: break-all;
  padding: 8px 10px;
  background: var(--rail-wash);
  border-left: 1px solid var(--hairline);
}
.onion-dated {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
}

/* ── Contents panel ─────────────────────────────────────────────────── */
.contents-panel {
  display: inline-block;
  background: var(--furniture);
  border: 1px solid var(--hairline);
  padding: 14px 22px;
  margin: 18px 0;
  min-width: 220px;
}
.contents-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.contents-list { list-style: none; }
.contents-list li { margin-bottom: 2px; }
.contents-list a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--link);
  border-bottom: none;
}
.contents-list a:hover { color: var(--link-hover); border-bottom: none; }
.contents-num { color: var(--gold); margin-right: 6px; }

/* ── Data tables ─────────────────────────────────────────────────────── */
.article-col table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  background: var(--article);
  font-family: var(--sans);
  font-size: 13px;
  margin: 18px 0;
  max-width: 44em;
}
.article-col th {
  background: var(--deep-tint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--platinum);
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.article-col td {
  padding: 8px 12px;
  color: var(--body-plat);
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
  position: relative;
}
.article-col tr:nth-child(even) td { background: var(--furniture); }
.article-col tr:hover td::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--gold);
}
.article-col code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}

/* ── Notice boxes ────────────────────────────────────────────────────── */
.notice {
  background: var(--note-bg);
  border-left: 2px solid var(--gold);
  padding: 10px 14px;
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--body-plat);
  margin: 18px 0;
  max-width: 44em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.notice.revealed { opacity: 1; transform: translateY(0); }
.notice-info   { background: var(--info-bg);    border-left-color: var(--link); }
.notice-caution{ background: var(--caution-bg); border-left-color: var(--link-missing); }
.notice-verified{background: var(--verified-bg);border-left-color: #5A8C6E; }
.notice-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.notice-info   .notice-label { color: var(--link); }
.notice-caution .notice-label { color: var(--link-missing); }
.notice-verified .notice-label { color: #5A8C6E; }
.notice .notice-label { color: var(--gold); }

/* ── References ──────────────────────────────────────────────────────── */
.references-section { margin-top: 36px; }
.references-list {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--body-plat);
  list-style: none;
  padding: 0;
  max-width: 44em;
}
.references-list li {
  margin-bottom: 4px;
  padding-left: 1.6em;
  text-indent: -1.6em;
}
.ref-back { color: var(--gold); margin-right: 6px; }
sup a {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--link);
  border-bottom: none;
  vertical-align: super;
  transition: color 120ms ease;
}
sup a:hover { color: var(--gold); }

/* ── Navbox ──────────────────────────────────────────────────────────── */
.navbox {
  background: var(--furniture);
  border: 1px solid var(--hairline);
  margin: 26px 0;
  max-width: 44em;
}
.navbox-title {
  background: var(--deep-tint);
  text-align: center;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--platinum);
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.navbox-chevron {
  font-size: 10px;
  color: var(--ghost);
  transition: transform 250ms ease;
  cursor: pointer;
  user-select: none;
}
.navbox.collapsed .navbox-chevron { transform: rotate(-90deg); }
.navbox-body { overflow: hidden; transition: max-height 300ms ease; }
.navbox.collapsed .navbox-body { max-height: 0; }
.navbox-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
}
.navbox-group {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ghost);
  padding: 10px 12px;
  background: var(--deep-tint);
  display: flex;
  align-items: center;
}
.navbox-links {
  padding: 8px 12px;
  line-height: 1.9;
  color: var(--body-plat);
}
.navbox-links a { border-bottom: none; margin-right: 10px; }

/* ── Category strip ──────────────────────────────────────────────────── */
.category-strip {
  border-top: 1px solid var(--hairline);
  padding: 12px 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--body-plat);
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.cat-label {
  color: var(--ghost);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cat-tag {
  background: var(--deep-tint);
  border: 1px solid var(--hairline);
  padding: 3px 10px;
  color: var(--link);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  transition: border-color 150ms ease, color 150ms ease;
}
.cat-tag:hover {
  border-color: var(--gold);
  color: var(--link-hover);
}

/* ── Footer ──────────────────────────────────────────────────────────── */
footer[role="contentinfo"] {
  background: var(--rail-wash);
  border-top: 1px solid var(--hairline);
  padding: 20px 24px 28px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: flex-start;
}
.foot-brand {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--platinum);
  border-bottom: none;
}
.foot-brand:hover { border-bottom: none; }
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.foot-links a {
  color: var(--muted);
  font-size: 11px;
  border-bottom: none;
  letter-spacing: 0.06em;
}
.foot-links a:hover { color: var(--platinum); border-bottom: none; }
.foot-copy { width: 100%; color: var(--ghost); }
.logo-foot {
  width: 140px;
  height: auto;
  filter: brightness(0.6) saturate(0.4);
}

/* ── Animations ──────────────────────────────────────────────────────── */
@keyframes ruleDraw {
  from { width: 0; }
  to   { width: 100%; }
}
@keyframes cardRise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Reduced motion ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .brand-mark::after,
  .article-title::after { animation: none; width: 100%; }
  .section-heading { opacity: 1; transform: none; transition: none; }
  .section-heading::after { width: 40px; }
  .notice { opacity: 1; transform: none; transition: none; }
  .infobox { animation: none; }
  .toc-entry { transition: none; }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .left-rail { display: none; }
  .left-rail.rail-open { display: block; width: 100%; min-height: auto; border-right: none; border-bottom: 1px solid var(--hairline); }
  .bar-toggle { display: inline-flex; align-items: center; gap: 6px; }
  .article-col { padding: 20px 18px 36px; }
  .infobox { float: none; width: 100%; margin: 0 0 20px 0; }
  .top-bar-search { max-width: 200px; }
  .top-bar-tools { display: none; }
}
@media (max-width: 520px) {
  .top-bar-search { display: none; }
  .article-title { font-size: 26px; }
}

.onion-copy {
  cursor: pointer;
}
.onion-copy:hover {
  outline: 1px dashed currentColor;
  outline-offset: 2px;
}
.onion-copy.is-copied {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}
.onion-copy.is-copied::after {
  content: " copied";
  font-size: 0.72em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-left: 0.4em;
}
