/* ==========================================================================
   Darknet Market Field Guide — design system
   Dark theme · orange accent (hub-wide brand) · zero third-party requests
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #0b0c0e;
  --bg-soft: #101317;
  --bg-card: #14181d;
  --bg-elev: #1a1f26;
  --bg-code: #090a0c;

  /* Lines */
  --border: #23282f;
  --border-strong: #323944;

  /* Text */
  --text-main: #f2f4f7;
  --text-muted: #b7bec9;
  --text-dim: #8d95a3;

  /* Brand */
  --accent: #ff7a00;
  --accent-hover: #ff9530;
  --accent-soft: rgba(255, 122, 0, 0.12);
  --accent-line: rgba(255, 122, 0, 0.32);

  /* Semantic */
  --ok: #3fcf8e;
  --info: #5aa9ff;
  --warn: #ffc046;
  --danger: #ff6b6b;

  /* Type */
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Code",
    Consolas, "Liberation Mono", Menlo, monospace;

  /* Metrics */
  --container: 1180px;
  --header-height: 64px;
  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

::selection {
  background: var(--accent);
  color: #101010;
}

/* --------------------------------------------------------------------------
   Layout primitives
   -------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: #101010;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  left: 0;
  text-decoration: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Spacing utilities — used instead of inline styles */
.mb-0 {
  margin-bottom: 0 !important;
}

.mb-sm {
  margin-bottom: 0.6rem !important;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-mono);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
  text-wrap: balance;
}

h1 {
  font-size: clamp(1.95rem, 1.35rem + 2.6vw, 3rem);
}

h2 {
  font-size: clamp(1.4rem, 1.18rem + 0.9vw, 1.85rem);
}

h3 {
  font-size: clamp(1.1rem, 1.03rem + 0.35vw, 1.3rem);
  color: var(--accent);
}

h4 {
  font-size: 1rem;
  color: var(--text-main);
}

p {
  margin-bottom: 1.05rem;
  color: #e4e8ee;
  text-wrap: pretty;
}

strong {
  color: #fff;
}

code,
kbd {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.12em 0.42em;
  color: var(--accent-hover);
  overflow-wrap: anywhere;
}

ul,
ol {
  margin: 0 0 1.05rem 1.25rem;
  color: #e4e8ee;
}

li {
  margin-bottom: 0.45rem;
}

li::marker {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease,
    border-color 0.18s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--accent);
  color: #101010;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #101010;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.top-bar {
  background: #000;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.top-bar-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-block: 9px;
}

.top-bar a {
  color: var(--accent);
  font-weight: 700;
}

.top-bar .dot {
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--header-height);
  background: rgba(11, 12, 14, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-height);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.02em;
}

.site-logo:hover {
  text-decoration: none;
  color: #fff;
}

.logo-mark {
  width: 36px;
  height: 36px;
  flex: none;
  display: block;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.logo-text span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a[aria-current="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius-sm);
  color: #101010;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  padding: 9px 13px;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(3rem, 2rem + 5vw, 5.5rem) 0 clamp(2.5rem, 2rem + 3vw, 4rem);
  border-bottom: 1px solid var(--border);
  background-image: radial-gradient(
      900px 340px at 18% -10%,
      rgba(255, 122, 0, 0.1),
      transparent 65%
    ),
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 100% 100%, 46px 46px, 46px 46px;
  background-position: center, center, center;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(11, 12, 14, 0.35),
    var(--bg) 92%
  );
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 100px;
  padding: 6px 14px;
  margin-bottom: 1.3rem;
}

.hero h1 {
  max-width: 23ch;
  margin-bottom: 1.1rem;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.lead {
  max-width: 66ch;
  font-size: clamp(1.02rem, 0.98rem + 0.25vw, 1.16rem);
  color: var(--text-muted);
  margin-bottom: 1.8rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 2.6rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.hero-stat {
  background: var(--bg-soft);
  padding: 1.1rem 1.25rem;
}

.hero-stat dt {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 2px;
}

.hero-stat dd {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Section shell
   -------------------------------------------------------------------------- */

.section {
  padding: clamp(2.6rem, 2rem + 3vw, 4.2rem) 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: var(--header-height);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-head {
  max-width: 78ch;
  margin-bottom: 2rem;
}

.section-head h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.7rem;
}

.section-head h2::before {
  content: "";
  width: 4px;
  height: 1em;
  flex: none;
  border-radius: 2px;
  background: var(--accent);
}

.section-head p {
  color: var(--text-muted);
  margin-bottom: 0;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Notice / callout blocks
   -------------------------------------------------------------------------- */

.notice {
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--info);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin: 1.6rem 0;
}

.notice p:last-child,
.notice ul:last-child {
  margin-bottom: 0;
}

.notice-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--info);
  margin-bottom: 0.65rem;
}

.notice-title svg {
  flex: none;
}

.notice-info {
  border-left-color: var(--info);
}

.notice-info .notice-title {
  color: var(--info);
}

.notice-warn {
  border-left-color: var(--warn);
}

.notice-warn .notice-title {
  color: var(--warn);
}

.notice-danger {
  border-left-color: var(--danger);
}

.notice-danger .notice-title {
  color: var(--danger);
}

.notice-ok {
  border-left-color: var(--ok);
}

.notice-ok .notice-title {
  color: var(--ok);
}

/* --------------------------------------------------------------------------
   Content grid + table of contents
   -------------------------------------------------------------------------- */

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 3rem;
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--header-height) + 20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 1.15rem 1.25rem;
}

.toc h2 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.85rem;
}

.toc ol {
  list-style: none;
  margin: 0;
  counter-reset: toc;
}

.toc li {
  margin-bottom: 2px;
}

.toc a {
  display: block;
  font-size: 0.86rem;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  line-height: 1.35;
}

.toc a:hover {
  background: var(--bg-elev);
  color: var(--text-main);
  text-decoration: none;
}

.toc a[aria-current="true"] {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

/* --------------------------------------------------------------------------
   Category catalog
   -------------------------------------------------------------------------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.4rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.35rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  border-color: var(--accent-line);
  border-top-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.category-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
}

.category-card h3 {
  margin: 0;
}

.category-card h3 a {
  color: #fff;
}

.category-card h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.category-card p {
  color: var(--text-muted);
  font-size: 0.94rem;
  margin: 0;
}

.topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-list li {
  margin: 0;
}

.topic-list span {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  padding: 3px 10px;
}

.category-link {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-link:hover {
  text-decoration: none;
  gap: 10px;
}

/* --------------------------------------------------------------------------
   Reference sections
   -------------------------------------------------------------------------- */

.ref-section {
  padding-top: 2.6rem;
  scroll-margin-top: calc(var(--header-height) + 16px);
}

.ref-section + .ref-section {
  margin-top: 1.4rem;
  border-top: 1px dashed var(--border);
}

.ref-section > h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 1rem;
}

.ref-section > h2 .num {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  flex: none;
}

.ref-section h3 {
  margin: 1.8rem 0 0.7rem;
}

.prose > ul,
.prose > ol {
  padding-left: 1.35rem;
}

.prose li {
  margin-bottom: 0.55rem;
}

.def-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 0;
}

.def-item {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}

.def-list dt {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.def-list dd {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.6rem 0;
  -webkit-overflow-scrolling: touch;
}

.table-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.table-hint {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
  margin: -1.1rem 0 1.6rem;
}

@media (max-width: 760px) {
  .table-hint {
    display: block;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 520px;
}

caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding: 0.9rem 1.1rem 0.6rem;
}

th,
td {
  text-align: left;
  padding: 0.75rem 1.1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  background: var(--bg-elev);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

td strong {
  color: #fff;
}

/* --------------------------------------------------------------------------
   Terminal / example block
   -------------------------------------------------------------------------- */

.terminal {
  background: var(--bg-code);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--text-muted);
  overflow-x: auto;
}

.terminal .t-line {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal .t-prompt {
  color: var(--accent);
}

.terminal .t-comment {
  color: var(--text-dim);
}

.terminal .t-ok {
  color: var(--ok);
}

.terminal .t-warn {
  color: var(--warn);
}

.terminal-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Checklist
   -------------------------------------------------------------------------- */

.checklist {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.checklist li {
  margin: 0;
  position: relative;
  padding: 0.85rem 1rem 0.85rem 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.94rem;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 1.05rem;
  top: 1.12rem;
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  border-radius: 3px;
}

.checklist strong {
  display: block;
  color: #fff;
  margin-bottom: 0.15rem;
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq-list {
  display: grid;
  gap: 0.7rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item[open] {
  border-color: var(--accent-line);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.25rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  flex: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item summary:hover {
  color: var(--accent);
}

.faq-body {
  padding: 0 1.25rem 1.2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.faq-body p:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Sources
   -------------------------------------------------------------------------- */

.source-list {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.8rem;
}

.source-list li {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.source-list .src-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.source-list .src-name a {
  color: #fff;
  text-decoration: none;
}

.source-list .src-name a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.source-list .src-desc {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   CTA band
   -------------------------------------------------------------------------- */

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  margin-top: 2rem;
}

.cta-band h3 {
  margin: 0 0 0.3rem;
}

.cta-band p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
  max-width: 62ch;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  background: #000;
  border-top: 3px solid var(--accent);
  padding: 3rem 0 1.6rem;
  margin-top: 3rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 2.2rem;
}

.footer-brand p {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 0.9rem 0 0;
  max-width: 42ch;
}

.site-footer h2 {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #fff;
  margin-bottom: 0.9rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 0.5rem;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-bottom {
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.footer-disclaimer {
  margin-top: 1.4rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   Back to top
   -------------------------------------------------------------------------- */

.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 90;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  background: var(--accent);
  color: #101010;
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }

  .toc {
    position: static;
    order: -1;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.8rem;
  }
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }

  body.js .menu-toggle {
    display: block;
  }

  body.js .nav-links.is-open {
    display: flex;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #000;
    border-bottom: 2px solid var(--accent);
    padding: 0.6rem 20px 1rem;
    box-shadow: var(--shadow);
  }

  body.js .nav-links.is-open a {
    display: block;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border);
  }

  body.js .nav-links.is-open li:last-child a {
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  .hero-stats {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Motion & print
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .btn:hover,
  .category-card:hover {
    transform: none;
  }
}

@media print {
  .top-bar,
  .site-header,
  .toc,
  .to-top,
  .hero-actions,
  .menu-toggle {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .ref-section {
    page-break-inside: avoid;
  }
}
