/* SPDX-License-Identifier: GPL-3.0-or-later
 *
 * One stylesheet, no framework, no web fonts, no third-party requests of any
 * kind. A site for a privacy tool has no business loading a CDN: every remote
 * asset is a request that tells someone else you were here.
 *
 * Typography is monospace throughout, from the fonts the reader already has.
 */

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

html { scroll-behavior: smooth; }

@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;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "JetBrains Mono", "Cascadia Code", "Fira Code", "SF Mono",
               "DejaVu Sans Mono", Consolas, ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: var(--accent); }
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */

header.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.top .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.06em; }
.brand img { width: 26px; height: 26px; image-rendering: pixelated; }
.brand a { color: var(--fg); border: 0; }

nav.links { display: flex; gap: 14px; margin-left: auto; flex-wrap: wrap; }
nav.links a { color: var(--muted); font-size: 13px; }
nav.links a:hover { color: var(--accent); }

.theme-pick {
  background: var(--bg-soft);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

/* ---------- hero ---------- */

.hero { padding: 54px 0 34px; text-align: center; }

.hero img.banner {
  width: 100%;
  max-width: 860px;
  height: auto;
  image-rendering: pixelated;
  border: 1px solid var(--border);
  border-radius: 10px;
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.tagline { color: var(--muted); margin: 22px auto 0; max-width: 640px; }
.tagline strong { color: var(--fg); }

/* Staggered entrance. Each element declares its own delay via --i. */
.stagger > * {
  animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

/* ---------- the veil animation ---------- */
/* Bars start even and blue on the left, fragment and shift purple to the
 * right: the product in one picture, matching the icon. Pure CSS. */

.veil { display: flex; gap: 3px; justify-content: center; align-items: center;
        height: 74px; margin: 30px 0 6px; }
.veil span {
  width: 5px;
  border-radius: 2px;
  background: var(--accent);
  animation: pulse 1.9s ease-in-out infinite;
}
.veil span.veiled { background: var(--accent-2); opacity: 0.85; }

@keyframes pulse {
  0%, 100% { height: 16%; }
  50%      { height: 82%; }
}

/* ---------- reveal on scroll ---------- */
/* Scoped to html.js, which theme.js sets from a blocking head script. Without
 * JavaScript these rules never apply and the content is simply visible — the
 * one failure mode a reveal effect must not have.
 *
 * Only opacity and transform are animated, so the compositor handles it
 * without a layout pass. `prefers-reduced-motion` is already neutralised
 * globally at the top of this file, and reveal.js additionally skips the
 * observer entirely in that case. */

.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- the walkthrough ---------- */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 18px 0 0; }

.step {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 46px;
  margin: 0;
}
/* The connecting rail, drawn once per step rather than as a separate element. */
.step::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 26px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.step:last-child { padding-bottom: 0; }
.step:last-child::before { display: none; }

.step::after {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--bg-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.step h3 { margin: 2px 0 6px; color: var(--fg); }
.step p  { margin: 0; color: var(--muted); font-size: 13.5px; }
.step pre { margin: 10px 0 0; }

/* Two panels side by side: what the window shows, what the shell does. */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

/* A key/value strip for the "two passwords" comparison. */
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 16px 0; }
.compare > div {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
}
.compare .lock  { border-left-color: var(--accent); }
.compare .vault { border-left-color: var(--accent-2); }
.compare h4 { margin: 0 0 6px; font-size: 13.5px; color: var(--fg); letter-spacing: 0.03em; }
.compare p  { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- buttons ---------- */

.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 26px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); background: var(--bg-inset); }
.btn:active { transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 700; }
.btn.primary:hover { background: var(--accent); filter: brightness(1.08); }

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

section { padding: 40px 0; border-top: 1px solid var(--border); }
section:first-of-type { border-top: 0; }

h1, h2, h3, h4 { line-height: 1.3; }
h1 { font-size: 30px; letter-spacing: 0.04em; margin: 0 0 8px; }
h2 { font-size: 20px; color: var(--accent); margin: 0 0 16px; letter-spacing: 0.03em; }
h3 { font-size: 15px; color: var(--accent-2); margin: 22px 0 8px; }
h4 { font-size: 13.5px; color: var(--cyan); margin: 16px 0 6px; letter-spacing: 0.02em; }

.lede { color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }

.card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin-top: 0; }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; }

.note {
  border-left: 3px solid var(--warn);
  background: var(--bg-soft);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  margin: 18px 0;
}
.note.good { border-left-color: var(--ok); }
.note.bad  { border-left-color: var(--err); }
.note p:first-child { margin-top: 0; }
.note p:last-child  { margin-bottom: 0; }

code, pre, kbd { font-family: inherit; }

code:not(pre code) {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.9em;
  color: var(--cyan);
}

pre {
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
}

table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--accent); font-weight: 700; }

ul, ol { padding-left: 22px; }
li { margin: 5px 0; }

/* ---------- verifier ---------- */

.tool { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }

.drop {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.drop:hover, .drop.hot { border-color: var(--accent); color: var(--fg); background: var(--bg-inset); }

input[type="text"] {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--fg);
  font: inherit;
  font-size: 12.5px;
  padding: 9px 11px;
  margin-top: 10px;
}

.hash {
  font-size: 12.5px;
  word-break: break-all;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 12px;
  color: var(--cyan);
}

.verdict { margin-top: 12px; padding: 12px 14px; border-radius: 8px; font-weight: 700; }
.verdict.match { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border: 1px solid var(--ok); }
.verdict.fail  { background: color-mix(in srgb, var(--err) 16%, transparent); color: var(--err); border: 1px solid var(--err); }

progress { width: 100%; height: 6px; margin-top: 12px; }

/* ---------- repo panel ---------- */

.stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 6px 0 14px; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 22px; color: var(--cyan); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- the repository panel, while it loads ---------- */
/* The fetch is opt-in and can take a moment over a slow link, so the panel
 * says so with movement rather than leaving four em dashes sitting there
 * looking like the answer. Only opacity and transform are animated. */

.repo-loading .stat b,
.repo-loading #repo-desc {
  animation: breathe 1.4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.85; }
}

/* Each panel piece arrives with the same rise the hero uses, staggered by its
 * own --i so the stats do not all land at once. */
.repo-in { animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.repo-in { animation-delay: calc(var(--i, 0) * 60ms); }

/* The spinner on the button itself, so the control that was pressed is the
 * thing that shows it is working. */
.btn .spin {
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.readme { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 6px 20px 20px; }
.readme img { max-width: 100%; height: auto; image-rendering: pixelated; border-radius: 8px; }
.readme h1 { font-size: 22px; } .readme h2 { font-size: 17px; } .readme h3 { font-size: 14px; }
.readme blockquote {
  margin: 14px 0; padding: 10px 16px;
  border-left: 3px solid var(--accent); background: var(--bg-inset); color: var(--muted);
}

/* syntax highlighting — deliberately small, applied by js/markdown.js */
.tok-kw   { color: var(--accent-2); }
.tok-str  { color: var(--ok); }
.tok-num  { color: var(--warn); }
.tok-com  { color: var(--muted); font-style: italic; }
.tok-fn   { color: var(--cyan); }
.tok-attr { color: var(--warn); }

/* ---------- wiki ---------- */

.wiki-layout { display: grid; grid-template-columns: 200px 1fr; gap: 30px; align-items: start; }
.toc { position: sticky; top: 74px; font-size: 13px; }
.toc a { display: block; color: var(--muted); padding: 3px 0; border: 0; }
.toc a:hover, .toc a.active { color: var(--accent); }
@media (max-width: 720px) {
  .wiki-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
}

details {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0;
  background: var(--bg-soft);
}
summary { cursor: pointer; color: var(--accent); }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 46px;
  color: var(--muted);
  font-size: 12.5px;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

.fp { font-size: 11.5px; word-break: break-all; color: var(--cyan); }

.noscript-banner {
  background: var(--bg-soft);
  border: 1px solid var(--warn);
  border-left-width: 3px;
  border-radius: 0 8px 8px 0;
  padding: 14px 16px;
  margin: 20px 0;
}

/* ---------- welcome / legal gate ---------- */

body.legal-locked { overflow: hidden; }

.legal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--bg-inset) 82%, transparent);
  backdrop-filter: blur(6px);
  animation: fade 0.25s ease both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.legal-box {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 28px;
  animation: rise 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.legal-box h2 { margin-top: 0; color: var(--accent); letter-spacing: 0.05em; }
.legal-box p { font-size: 13.5px; }
.legal-box ul { font-size: 13px; color: var(--fg); }

.legal-warn {
  border-left: 3px solid var(--warn);
  background: var(--bg-soft);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
}

.legal-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
  font-size: 13px;
  cursor: pointer;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  transition: border-color 0.15s ease;
}
.legal-check:hover { border-color: var(--accent); }
.legal-check input { margin-top: 3px; accent-color: var(--accent); flex: none; }

.legal-fine { color: var(--muted); font-size: 12px; }

#legal-go { width: 100%; justify-content: center; }
#legal-go:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
