/* Tor Onion — static documentation styles. No JavaScript, no remote fonts. */

:root {
  --plum: #231436;
  --plum-mid: #35204d;
  --plum-soft: #4a3168;
  --lilac: #c4b0e0;
  --gold: #c9a45c;
  --gold-dim: #a6863e;
  --cream: #f4efe4;
  --paper: #fffdf8;
  --ink: #1c1526;
  --muted: #5e5568;
  --line: #e4dccb;
  --code-bg: #1a1226;
  --code-fg: #efe8d8;
  --ok: #2f6f4e;
  --warn-bg: #f8eed8;
  --warn-ink: #5a4518;
  --note-bg: #ece6f6;
  --note-ink: #3a2754;
  --shadow: 0 12px 40px rgba(35, 20, 54, 0.08);
  --radius: 14px;
  --sidebar: 17.5rem;
  --header-h: 4.25rem;
  --prose: 46rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "Segoe UI", "Helvetica Neue", system-ui, -apple-system, sans-serif;
  font-size: 1.05rem;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: #5b3488;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--plum);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 20;
  padding: 0.45rem 0.8rem;
  background: var(--gold);
  color: var(--plum);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  min-height: var(--header-h);
  padding: 0.7rem 1.5rem;
  background: linear-gradient(180deg, var(--plum) 0%, #1c102c 100%);
  color: var(--paper);
  border-bottom: 3px solid var(--gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #7b4aa8;
  box-shadow: 0 0 0 2px rgba(201, 164, 92, 0.9);
}

.brand-text strong {
  display: block;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-text span {
  display: block;
  color: var(--lilac);
  font-size: 0.78rem;
  line-height: 1.3;
}

/* Layout */

.shell {
  display: grid;
  flex: 1;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  background: var(--cream);
}

@media (min-width: 861px) {
  .shell {
    background:
      linear-gradient(var(--paper), var(--paper)) 0 0 / var(--sidebar) 100% no-repeat,
      var(--cream);
  }
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow: auto;
  padding: 1.5rem 1.1rem 2.5rem;
  background: transparent;
  border-right: 1px solid var(--line);
}

.sidebar-label {
  margin: 0 0 0.85rem;
  color: var(--gold-dim);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.guide-nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-nav a {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  gap: 0.55rem;
  align-items: start;
  max-width: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}

.guide-nav a:hover {
  background: var(--cream);
}

.guide-nav a[aria-current="page"] {
  background: var(--note-bg);
  color: var(--plum);
  font-weight: 600;
}

.guide-nav .num {
  color: var(--gold-dim);
  font-family: Georgia, serif;
  font-weight: 700;
}

.guide-nav .child a {
  margin-left: 1.15rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.content {
  padding: 2rem 1.5rem 3.5rem;
}

.article {
  max-width: calc(var(--prose) + 8rem);
  margin: 0 auto;
  padding: 1.75rem 1.8rem 2.2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.crumbs {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.crumbs a {
  color: inherit;
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--plum);
  text-decoration: underline;
}

.kicker {
  margin: 0 0 0.35rem;
  color: var(--gold-dim);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  line-height: 1.2;
  color: var(--plum);
}

h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 3vw, 2.45rem);
}

h2 {
  margin: 2rem 0 0.75rem;
  padding-top: 0.4rem;
  font-size: 1.45rem;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

h3 {
  margin: 1.4rem 0 0.5rem;
  font-size: 1.15rem;
}

.lede {
  max-width: var(--prose);
  color: var(--muted);
  font-size: 1.12rem;
}

.prose p,
.prose ul,
.prose ol {
  max-width: var(--prose);
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose li + li {
  margin-top: 0.35rem;
}

/* Homepage */

.hero {
  margin-bottom: 1.5rem;
}

.hero p {
  max-width: 40rem;
}

.path {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 0.9rem;
  margin: 1.4rem 0 0.4rem;
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.05rem 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, var(--cream) 140%);
  color: inherit;
  text-decoration: none;
}

.card:hover {
  border-color: var(--lilac);
  box-shadow: var(--shadow);
}

.card .num {
  color: var(--gold-dim);
  font-family: Georgia, serif;
  font-size: 0.95rem;
  font-weight: 700;
}

.card h2 {
  margin: 0.2rem 0 0.45rem;
  font-size: 1.12rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.card .more {
  margin-top: auto;
  padding-top: 0.8rem;
  color: #5b3488;
  font-size: 0.86rem;
  font-weight: 650;
}

.req {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-top: 0.4rem;
}

.req div {
  padding: 1rem 1.1rem;
  background: var(--cream);
  border-radius: 12px;
}

.req h3 {
  margin-top: 0;
}

.req p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Steps */

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  margin: 0 0 1.15rem;
  padding: 1rem 1.05rem 1.05rem 3.3rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 1rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--plum);
  color: var(--paper);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.7rem;
  text-align: center;
}

.steps p {
  margin: 0 0 0.65rem;
}

.steps p:last-child {
  margin-bottom: 0;
}

/* Code */

pre,
.code {
  overflow-x: auto;
  margin: 0.65rem 0 0.2rem;
  padding: 0.85rem 1rem;
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 10px;
  font-family: "Cascadia Code", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
  line-height: 1.5;
}

pre {
  max-width: 100%;
}

code {
  font-family: "Cascadia Code", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

p code,
li code,
figcaption code {
  padding: 0.08em 0.35em;
  background: var(--cream);
  border-radius: 4px;
}

pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.flags {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.flags li {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.6rem;
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.flags code {
  color: var(--plum);
}

/* Callouts & figures */

.callout {
  max-width: var(--prose);
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--gold);
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 0 10px 10px 0;
}

.callout.note {
  border-left-color: var(--plum-soft);
  background: var(--note-bg);
  color: var(--note-ink);
}

.callout strong {
  display: block;
  margin-bottom: 0.15rem;
}

figure.shot {
  margin: 0.85rem 0 0.2rem;
  padding: 0.55rem;
  background: var(--cream);
  border-radius: 12px;
}

figure.shot img {
  display: block;
  width: 100%;
  border-radius: 8px;
}

figcaption {
  padding: 0.55rem 0.3rem 0.15rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.example {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.pager a {
  display: inline-block;
  max-width: 48%;
  text-decoration: none;
}

.pager .dir {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pager .title {
  color: var(--plum);
  font-weight: 650;
}

.pager .next {
  margin-left: auto;
  text-align: right;
}

.resources {
  display: grid;
  gap: 0.75rem;
}

.resources a {
  display: block;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
}

.resources a:hover {
  border-color: var(--lilac);
}

.resources strong {
  display: block;
  color: var(--plum);
}

.resources span {
  color: var(--muted);
  font-size: 0.9rem;
}

.credit {
  margin: 0 0 1.25rem;
}

.credit a {
  font-weight: 600;
}

.toc {
  max-width: var(--prose);
  margin: 0 0 1.4rem;
  padding: 0.9rem 1.05rem;
  background: var(--cream);
  border-radius: 12px;
}

.toc p {
  margin: 0 0 0.45rem;
  color: var(--gold-dim);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.toc ul {
  margin: 0;
  padding-left: 1.15rem;
}

.toc li + li {
  margin-top: 0.25rem;
}

.checklist {
  max-width: var(--prose);
  margin: 0 0 1.2rem;
  padding: 0.85rem 1rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.checklist li + li {
  margin-top: 0.55rem;
}

.checklist label {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  gap: 0.6rem;
  align-items: start;
  cursor: pointer;
}

.checklist input {
  margin: 0.35rem 0 0;
  accent-color: var(--plum);
}

.checklist a {
  font-weight: 600;
}

.checklist .hint {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.compare {
  overflow-x: auto;
  margin: 1rem 0;
}

table {
  width: 100%;
  max-width: var(--prose);
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td code {
  font-size: 0.84rem;
  word-break: break-all;
}

.site-footer {
  padding: 1.1rem 1.5rem 1.4rem;
  background: var(--plum);
  color: var(--lilac);
  font-size: 0.88rem;
}

.site-footer p {
  margin: 0;
  max-width: 50rem;
}

.site-footer a {
  color: var(--gold);
}

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1rem;
    background: var(--paper);
  }

  .guide-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .guide-nav .child {
    grid-column: 1 / -1;
  }

  .article {
    padding: 1.2rem 1rem 1.5rem;
  }

  .req {
    grid-template-columns: 1fr;
  }

  .steps > li {
    padding-left: 1.05rem;
    padding-top: 2.7rem;
  }

  .steps > li::before {
    top: 0.75rem;
  }
}

@media (max-width: 560px) {
  .guide-nav {
    grid-template-columns: 1fr;
  }

  .pager {
    flex-direction: column;
  }

  .pager a,
  .pager .next {
    max-width: none;
    margin-left: 0;
    text-align: left;
  }
}

@media print {
  .site-header,
  .sidebar,
  .pager,
  .site-footer,
  .skip {
    display: none;
  }

  .shell,
  .content,
  .article {
    display: block;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: #fff;
  }

  a {
    color: inherit;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
