:root {
  color-scheme: dark;
  --bg: #070708;
  --card: #121214;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f5f6;
  --dim: #8e8e96;
  --faint: #5e5e66;
  --accent: #e7a3b4;
  --fill: #8f3048;
  --ink: #fff5f6;
  --ok: #3ddc84;
  --sans: "Segoe UI", "Helvetica Neue", sans-serif;
  --mono: Consolas, "Cascadia Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

body {
  min-height: 100vh;
  background-image: radial-gradient(540px 280px at 50% 0%, rgba(143, 48, 72, 0.22), transparent 70%);
}

.stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.stage-open {
  align-items: safe center;
  justify-content: safe center;
  padding: 32px 16px;
}

.card {
  width: min(400px, 100%);
  padding: 28px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
}

.kicker, .badge {
  margin: 0;
  text-align: center;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.badge {
  display: table;
  margin: 0 auto 16px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--ink);
}

h1 {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.04em;
  text-align: center;
}

.lede {
  margin: 8px 0 0;
  color: var(--dim);
  font-size: 14px;
  text-align: center;
}

.mirrors {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.mirrors li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
}

.mirrors em {
  font-style: normal;
  color: var(--faint);
}

.mirrors li[data-state="run"] { color: var(--text); }
.mirrors li[data-state="run"] em { color: var(--accent); }
.mirrors li[data-state="dead"] em { color: var(--faint); }
.mirrors li[data-state="live"] { color: var(--text); }
.mirrors li[data-state="live"] em { color: var(--ok); }

.meter {
  height: 2px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.meter span {
  display: block;
  height: 2px;
  width: 0;
  background: var(--accent);
}

.connect {
  position: relative;
  padding-top: 36px;
  text-align: center;
}

.rail {
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 2px;
  background: var(--ok);
}

.mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 8px auto 16px;
  border: 1px solid rgba(61, 220, 132, 0.35);
  border-radius: 50%;
  background: rgba(61, 220, 132, 0.08);
  color: var(--ok);
}

.mark svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.connect h2 {
  margin: 0;
  color: var(--ok);
  font-size: 22px;
  font-weight: 600;
}

.connect p {
  margin: 8px 0 12px;
  color: var(--dim);
  font-size: 14px;
}

.routes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.route {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #1a1a1d;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.route svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route span { flex: 1; }

.route small {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.route i {
  width: 7px;
  height: 7px;
  border-top: 1.6px solid currentColor;
  border-right: 1.6px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.7;
}

.route-primary {
  border-color: var(--fill);
  background: var(--fill);
  color: var(--ink);
}

.route-line {
  border-color: rgba(231, 163, 180, 0.45);
  background: #1a1214;
  color: var(--accent);
}

.route:hover { border-color: var(--accent); }

.route-primary:hover { background: #a8435c; }

.fine {
  margin: 16px 0 0;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.home {
  width: min(920px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.home .card { width: 100%; }

.guide { text-align: left; }

.guide-kicker { text-align: left; }

.guide h2 {
  margin: 8px 0 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.guide-lead {
  margin: 8px 0 0;
  color: var(--dim);
  font-size: 14px;
  line-height: 1.45;
}

.onion {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.onion code {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c0c0e;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.copy {
  flex: none;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--fill);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.copy:hover { background: #a8435c; }

.tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.tab {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.tab.on {
  border-color: var(--fill);
  background: var(--fill);
  color: var(--ink);
}

.steps {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.steps li span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}

.steps p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.steps strong { font-weight: 600; }

.tor-open,
.tor-backdrop,
.tor-x { display: none; }

.tor-x svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

@media (max-width: 860px) {
  .home {
    grid-template-columns: minmax(0, 420px);
    justify-content: center;
    width: min(420px, 100%);
  }

  .stage-open { padding: 24px 16px; }

  .onion { flex-direction: column; }

  .copy { width: 100%; }

  .tor-open { display: flex; }

  .guide { display: none; }

  .home.tor-on .tor-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 20;
    border: 0;
    padding: 0;
    background: rgba(7, 7, 8, 0.92);
    cursor: pointer;
  }

  .home.tor-on .guide {
    display: block;
    position: fixed;
    z-index: 21;
    top: 16px;
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
    max-width: 440px;
    height: fit-content;
    max-height: calc(100dvh - 32px);
    margin: auto;
    overflow: auto;
  }

  .home.tor-on .tor-x {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #0c0c0e;
    color: var(--text);
    cursor: pointer;
  }
}
