/* silentpayments.net · "Quiet Signal"
 *
 * One stylesheet for every page. No frameworks, no webfonts, no requests off
 * this host. The CSP served by nginx is `default-src 'none'` with `style-src
 * 'self'`, which means inline <style> blocks and inline style="" attributes are
 * BLOCKED. Everything visual therefore lives in this file, and SVG uses either
 * classes from here or plain presentation attributes.
 *
 * The colour system is semantic, not decorative:
 *   red   = exposed. Something anyone can read.
 *   mint  = private. Something only the two parties can derive.
 *   violet= proof. A signature chain you can check yourself.
 *   orange= bitcoin, and the one action colour.
 * Red and mint are the load-bearing pair, so they never carry meaning alone:
 * every use is paired with a word. (Checked: OKLab CVD separation 12.6, well
 * above the 8 needed, but a label costs nothing and a colourblind reader is
 * not a rounding error.)
 */

:root {
  --void: #08090a;
  --panel: #0e1012;
  --panel-2: #131619;
  --sunken: #060708;
  --line: #20252a;
  --line-hi: #2f363d;

  --fg: #e6e9ec;
  --dim: #9aa4ad;
  --faint: #6b747d;

  --orange: #f7931a;
  --orange-hi: #ffab3f;
  --mint: #4fd6b0;
  --red: #ff5f52;
  --violet: #a78bfa;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1120px;
  --prose: 68ch;
  --r: 3px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--void);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* A faint scanline wash and a single cold glow behind the masthead. Both are
   pure gradients: no image requests, and img-src would not allow them anyway. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120ch 60ch at 50% -20ch, rgba(247, 147, 26, 0.055), transparent 70%),
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.014) 0 1px,
      transparent 1px 3px
    );
}

body > * { position: relative; z-index: 1; }

.wrap { width: min(var(--wrap), 100% - 3rem); margin-inline: auto; }
.narrow { max-width: var(--prose); }

a {
  color: var(--orange);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(247, 147, 26, 0.4);
}
a:hover { color: var(--orange-hi); text-decoration-color: currentColor; }

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

code, .mono, kbd { font-family: var(--mono); font-size: 0.92em; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--orange);
  color: #0a0a0a;
  padding: 0.6rem 1rem;
  font-weight: 700;
  z-index: 100;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------------------------------------------------------------- masthead */

header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8, 9, 10, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 0;
}
.mark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.03em;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.mark:hover { color: var(--fg); }
.mark .dot { color: var(--orange); }

nav.site {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
nav.site::-webkit-scrollbar { display: none; }
nav.site a {
  color: var(--dim);
  text-decoration: none;
  padding: 0.4rem 0.6rem;
  border-radius: var(--r);
  white-space: nowrap;
}
nav.site a:hover { color: var(--fg); background: var(--panel-2); }
nav.site a[aria-current="page"] { color: var(--fg); box-shadow: inset 0 -1px 0 var(--orange); }
nav.site a.cta {
  color: #0a0a0a;
  background: var(--orange);
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  margin-left: 0.4rem;
}
nav.site a.cta:hover { background: var(--orange-hi); color: #0a0a0a; }

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

section { padding: 5.5rem 0; border-bottom: 1px solid var(--line); }
section.tight { padding: 3.5rem 0; }
section:last-of-type { border-bottom: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--faint);
  margin: 0 0 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

h1 {
  font-family: var(--mono);
  font-size: clamp(2rem, 5.2vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 700;
  margin: 0 0 1.5rem;
}
h2 {
  font-family: var(--mono);
  font-size: clamp(1.45rem, 3.1vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 1.1rem;
}
h3 {
  font-family: var(--mono);
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
h4 {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--dim);
  font-weight: 700;
  margin: 0 0 0.6rem;
}

p { margin: 0 0 1.15rem; max-width: var(--prose); }
p:last-child { margin-bottom: 0; }

.lede { font-size: 1.16rem; color: var(--dim); }
.hl { color: var(--orange); }
.hl-mint { color: var(--mint); }
.hl-red { color: var(--red); }
.hl-violet { color: var(--violet); }

hr.rule { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

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

/* Hero headlines carry explicit line breaks rather than a character cap, so the
   shape of the stack is the same on every screen instead of depending on how
   wide the reader's monospace font happens to be. */
.hero { padding-top: 5rem; padding-bottom: 4.5rem; }
.hero .lede { max-width: 60ch; }

.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2.25rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  border-radius: var(--r);
  background: var(--orange);
  color: #0a0a0a;
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--orange);
}
.btn:hover { background: var(--orange-hi); border-color: var(--orange-hi); color: #0a0a0a; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line-hi); }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--dim); color: var(--fg); }

/* ---------------------------------------------------------------- panels */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.5rem;
}
.panel > :last-child { margin-bottom: 0; }
.panel p { color: var(--dim); font-size: 0.95rem; }
.panel.exposed { border-top: 2px solid var(--red); }
.panel.private { border-top: 2px solid var(--mint); }
.panel.proof { border-top: 2px solid var(--violet); }
.panel.warn { border-left: 2px solid var(--red); }
.panel.fix { border-left: 2px solid var(--mint); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.mt { margin-top: 2rem; }
.mt-s { margin-top: 1.25rem; }

/* ---------------------------------------------------------------- tags */

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 2px;
  border: 1px solid currentColor;
  vertical-align: middle;
}
.tag.exposed { color: var(--red); }
.tag.private { color: var(--mint); }
.tag.proof { color: var(--violet); }
.tag.neutral { color: var(--faint); }
.tag.live { color: var(--orange); }

/* ---------------------------------------------------------------- code */

.addr {
  display: block;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  word-break: break-all;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.7rem 0.8rem;
  color: var(--dim);
  margin: 0.75rem 0 1rem;
}
.addr.exposed { color: var(--red); }
.addr.private { color: var(--mint); }
.addr.name { color: var(--mint); font-size: 1rem; word-break: break-word; }

pre.block {
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.65;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-hi);
  border-radius: var(--r);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  color: var(--dim);
  margin: 1.25rem 0;
  max-width: 100%;
}
pre.block b { color: var(--fg); font-weight: 600; }
pre.block .c { color: var(--faint); }
pre.block .k { color: var(--orange); }
pre.block .m { color: var(--mint); }
pre.block .v { color: var(--violet); }

.kv {
  font-family: var(--mono);
  font-size: 0.82rem;
  display: grid;
  grid-template-columns: minmax(9rem, auto) 1fr;
  gap: 0.35rem 1.25rem;
  margin: 1.25rem 0;
}
.kv dt { color: var(--faint); }
.kv dd { margin: 0; color: var(--fg); word-break: break-all; }

/* ---------------------------------------------------------------- quotes */

blockquote.quote {
  margin: 2rem 0;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--line-hi);
  max-width: var(--prose);
}
blockquote.quote p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--fg);
  font-style: normal;
}
blockquote.quote footer {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--faint);
  margin-top: 0.75rem;
  padding: 0;
  border: 0;
}
blockquote.quote.big p { font-size: 1.35rem; letter-spacing: -0.015em; }

.cite {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--faint);
}
.cite a { color: var(--faint); text-decoration-color: var(--line-hi); }
.cite a:hover { color: var(--dim); }

.sources {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.9;
  columns: 2;
  column-gap: 2.5rem;
}
.sources li { break-inside: avoid; color: var(--faint); }
.sources a { color: var(--dim); text-decoration-color: var(--line-hi); }

/* ---------------------------------------------------------------- steps */

ol.steps { counter-reset: step; list-style: none; padding: 0; margin: 2.5rem 0 0; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 3.5rem;
  margin-bottom: 2.5rem;
}
ol.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid var(--line-hi);
  background: var(--panel);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--orange);
}
ol.steps p { color: var(--dim); }

/* ---------------------------------------------------------------- anonymity grid */

.anon {
  margin: 2rem 0 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  overflow: hidden;
}
.anon-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--dim);
}
.anon-bar .spacer { flex: 1; }
.seg {
  display: inline-flex;
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  overflow: hidden;
}
.seg button {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  background: transparent;
  color: var(--dim);
  border: 0;
  cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--line-hi); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--void); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--fg); background: var(--panel); }

.anon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11px, 1fr));
  gap: 3px;
  padding: 0.9rem;
}
.anon-grid i {
  display: block;
  aspect-ratio: 1;
  background: #1b2026;
  border-radius: 1px;
  transition: background-color 260ms ease;
}
.anon-grid i.mine { background: var(--red); }
.anon-grid i.blend { background: #262c33; }
.anon-grid i.mint { background: var(--mint); }
.anon-caption {
  padding: 0.75rem 0.9rem 0.9rem;
  font-size: 0.86rem;
  color: var(--dim);
  border-top: 1px solid var(--line);
  max-width: none;
}
.anon-caption strong { color: var(--fg); font-weight: 600; }

/* ---------------------------------------------------------------- diagrams */

figure.diagram {
  margin: 2.5rem 0;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  overflow: hidden;
}
figure.diagram .scroller { overflow-x: auto; padding: 1.25rem; }
figure.diagram svg { display: block; width: 100%; height: auto; min-width: 640px; }
figure.diagram figcaption {
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--dim);
  max-width: none;
  background: var(--panel-2);
}
figure.diagram.wide svg { min-width: 900px; }

/* SVG token classes. Presentation attributes would work too, but keeping them
   here means one place to retune the whole drawing. */
.d-box { fill: #131619; stroke: #2f363d; stroke-width: 1; }
.d-box-sunken { fill: #060708; stroke: #20252a; stroke-width: 1; }
.d-box-red { fill: rgba(255, 95, 82, 0.07); stroke: #ff5f52; stroke-width: 1; }
.d-box-mint { fill: rgba(79, 214, 176, 0.07); stroke: #4fd6b0; stroke-width: 1; }
.d-box-violet { fill: rgba(167, 139, 250, 0.07); stroke: #a78bfa; stroke-width: 1; }
.d-box-orange { fill: rgba(247, 147, 26, 0.08); stroke: #f7931a; stroke-width: 1; }
.d-t { font-family: var(--mono); font-size: 11px; fill: #e6e9ec; }
.d-t-sm { font-family: var(--mono); font-size: 9.5px; fill: #9aa4ad; }
.d-t-xs { font-family: var(--mono); font-size: 8.5px; fill: #6b747d; }
.d-t-lbl {
  font-family: var(--mono);
  font-size: 8.5px;
  fill: #6b747d;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}
.d-orange { fill: #f7931a; }
.d-mint { fill: #4fd6b0; }
.d-red { fill: #ff5f52; }
.d-violet { fill: #a78bfa; }
.d-dim { fill: #9aa4ad; }
.d-faint { fill: #6b747d; }
.d-line { stroke: #2f363d; stroke-width: 1; fill: none; }
.d-line-dash { stroke: #2f363d; stroke-width: 1; fill: none; stroke-dasharray: 3 3; }
.d-line-mint { stroke: #4fd6b0; stroke-width: 1.25; fill: none; }
.d-line-red { stroke: #ff5f52; stroke-width: 1.25; fill: none; }
.d-line-violet { stroke: #a78bfa; stroke-width: 1.25; fill: none; }
.d-line-orange { stroke: #f7931a; stroke-width: 1.25; fill: none; }
.d-fill-panel { fill: #0e1012; }
.d-mono-mid { text-anchor: middle; }
.d-mono-end { text-anchor: end; }

/* Stepper: dim every group except the active one. The groups are marked with a
   data-step attribute rather than a class, because the step number is data the
   script needs, and duplicating it as a class would be two things to keep in
   step with each other. */
.stepped [data-step] { opacity: 0.22; transition: opacity 240ms ease; }
.stepped [data-step].on { opacity: 1; }
.stepped [data-step].done { opacity: 0.62; }

.stepper {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--dim);
}
.stepper button {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.32rem 0.6rem;
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  cursor: pointer;
}
.stepper button:hover:not(:disabled) { color: var(--fg); border-color: var(--dim); }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper .count { color: var(--faint); }
.step-note {
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--dim);
  background: var(--panel-2);
  min-height: 3.2rem;
  max-width: none;
}
.step-note strong { color: var(--fg); font-weight: 600; }
.step-note code { color: var(--orange); }

/* The same prose as a plain list, for a reader with no JavaScript. The script
   hides it once it takes over. */
.step-notes {
  margin: 0;
  padding: 1.25rem 1.5rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 0.92rem;
  color: var(--dim);
}
.step-notes li { margin-bottom: 0.75rem; }
.step-notes li:last-child { margin-bottom: 0; }
.step-notes strong { color: var(--fg); font-weight: 600; }
.step-notes code { color: var(--orange); }

/* ---------------------------------------------------------------- timeline */

.timeline { list-style: none; padding: 0; margin: 2.5rem 0 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7.5rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 1px;
  background: var(--line);
}
.timeline > li {
  position: relative;
  padding-left: 9.5rem;
  padding-bottom: 2.5rem;
  min-height: 2rem;
}
.timeline .when {
  position: absolute;
  left: 0;
  top: 0;
  width: 6.5rem;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--faint);
  line-height: 1.5;
}
.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(7.5rem - 3.5px);
  top: 0.55rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-hi);
  border: 2px solid var(--void);
  box-sizing: content-box;
}
.timeline > li.key::before { background: var(--orange); }
.timeline > li.key .what h3 { color: var(--orange); }
.timeline > li.dead::before { background: var(--red); }
.timeline .what h3 { margin-bottom: 0.35rem; }
.timeline .what p { color: var(--dim); font-size: 0.94rem; margin-bottom: 0.5rem; }

/* ---------------------------------------------------------------- chart */

.chart { margin: 2rem 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.c-bar { fill: var(--orange); }
.c-bar-partial { fill: var(--orange); opacity: 0.42; }
.c-axis { stroke: var(--line); stroke-width: 1; }
.c-t { font-family: var(--mono); font-size: 10px; fill: var(--faint); }
.c-val { font-family: var(--mono); font-size: 10px; fill: var(--dim); text-anchor: middle; }
.c-lbl { font-family: var(--mono); font-size: 10px; fill: var(--faint); text-anchor: middle; }
/* Set by app.js once the chart scrolls into view, so the bars grow from the
   axis. Declared here rather than assigned inline: style-src is 'self'. */
.chart svg.growing [data-grow] {
  transition: y 520ms cubic-bezier(0.2, 0.7, 0.3, 1), height 520ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------------------------------------------------------------- stat tiles */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 2rem 0 0; }
.stat {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 1.15rem 1.1rem;
}
.stat .n {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--fg);
  display: block;
}
.stat .n.red { color: var(--red); }
.stat .n.orange { color: var(--orange); }
.stat .l {
  font-size: 0.84rem;
  color: var(--dim);
  margin: 0.5rem 0 0;
  max-width: none;
}
.stat .src {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
  margin: 0.6rem 0 0;
  max-width: none;
}
.stat .src a { color: var(--faint); }

/* ---------------------------------------------------------------- table */

.tbl { width: 100%; border-collapse: collapse; margin: 1.75rem 0; font-size: 0.88rem; }
.tbl th, .tbl td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.tbl th {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
  font-weight: 700;
  border-bottom-color: var(--line-hi);
}
.tbl td { color: var(--dim); }
.tbl td:first-child { color: var(--fg); }
.tbl td.mono, .tbl th.mono { font-family: var(--mono); font-size: 0.82rem; }
.tbl-scroll { overflow-x: auto; }

/* ---------------------------------------------------------------- claim form */

.claim form { margin-top: 2rem; max-width: 640px; }
label { display: block; margin-bottom: 1.5rem; }
label > span { display: block; font-weight: 600; margin-bottom: 0.45rem; font-size: 0.95rem; }
input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  background: var(--panel-2);
  border: 1px solid var(--line-hi);
  border-radius: var(--r);
  color: var(--fg);
}
input::placeholder { color: var(--faint); }
input:focus { outline: none; border-color: var(--orange); }
.namerow { display: flex; align-items: stretch; }
.namerow input { border-radius: var(--r) 0 0 var(--r); }
.suffix {
  display: grid;
  place-items: center;
  padding: 0 0.85rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--dim);
  background: var(--sunken);
  border: 1px solid var(--line-hi);
  border-left: 0;
  border-radius: 0 var(--r) var(--r) 0;
  white-space: nowrap;
}
label small { display: block; color: var(--dim); font-size: 0.85rem; margin-top: 0.45rem; line-height: 1.6; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }
button.act {
  padding: 0.7rem 1.25rem;
  border-radius: var(--r);
  border: 1px solid var(--line-hi);
  background: var(--panel-2);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}
button.act:hover:not(:disabled) { border-color: var(--dim); }
button.act.primary:not(:disabled) { background: var(--orange); color: #0a0a0a; border-color: var(--orange); }
button.act.primary:not(:disabled):hover { background: var(--orange-hi); border-color: var(--orange-hi); }
button.act:disabled { opacity: 0.4; cursor: not-allowed; }

#status { margin-top: 1rem; font-family: var(--mono); font-size: 0.85rem; min-height: 1.5em; max-width: none; }
#status.ok { color: var(--mint); }
#status.err { color: var(--red); }
#status.busy { color: var(--dim); }

#result {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--mint);
  border-radius: var(--r);
}
.secret {
  display: block;
  font-family: var(--mono);
  word-break: break-all;
  background: var(--sunken);
  border: 1px solid var(--line);
  padding: 0.8rem;
  border-radius: var(--r);
  color: var(--orange);
  margin: 0.75rem 0;
}
.keep { color: var(--dim); font-size: 0.94rem; }

/* ---------------------------------------------------------------- log page */

.chainline { font-family: var(--mono); font-size: 0.82rem; color: var(--dim); }
.chainline.ok { color: var(--mint); }
.chainline.bad { color: var(--red); }
.entry {
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-hi);
  border-radius: var(--r);
  background: var(--panel);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.6rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.entry.claim { border-left-color: var(--mint); }
.entry.update { border-left-color: var(--orange); }
.entry.release { border-left-color: var(--red); }
.entry .row { display: flex; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.entry .seq { color: var(--faint); }
.entry .nm { color: var(--fg); font-weight: 700; }
.entry .at { color: var(--faint); margin-left: auto; }
.entry .act { color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.68rem; }
.entry .hash { color: var(--faint); word-break: break-all; margin-top: 0.4rem; font-size: 0.72rem; }
.empty {
  border: 1px dashed var(--line-hi);
  border-radius: var(--r);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--dim);
  font-size: 0.92rem;
}
#filter { max-width: 280px; }

/* Every chart needs a table view for anyone the picture does not serve. */
details.datatable {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 0.7rem 1.1rem;
  margin: 1.5rem 0;
}
details.datatable > summary {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--dim);
  cursor: pointer;
  list-style: none;
}
details.datatable > summary::-webkit-details-marker { display: none; }
details.datatable > summary::before { content: "+ "; color: var(--orange); }
details.datatable[open] > summary::before { content: "\2212 "; }
details.datatable > summary:hover { color: var(--fg); }
details.datatable .tbl { margin-bottom: 0.5rem; }

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

.next {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}
.next a {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 1.15rem;
  text-decoration: none;
  color: var(--fg);
}
.next a:hover { border-color: var(--line-hi); background: var(--panel-2); color: var(--fg); }
.next .k {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--orange);
  display: block;
  margin-bottom: 0.5rem;
}
.next h3 { margin-bottom: 0.35rem; }
.next p { color: var(--dim); font-size: 0.88rem; margin: 0; max-width: none; }

footer.site {
  padding: 3.5rem 0 4rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.9rem;
  background: var(--sunken);
}
footer.site .cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
footer.site h4 { margin-bottom: 0.8rem; }
footer.site ul { list-style: none; padding: 0; margin: 0; font-size: 0.86rem; line-height: 2; }
footer.site ul a { color: var(--dim); text-decoration: none; }
footer.site ul a:hover { color: var(--fg); text-decoration: underline; }
footer.site .colophon {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--faint);
  line-height: 1.9;
}
footer.site .colophon p { max-width: 80ch; margin-bottom: 0.4rem; }
footer.site .colophon a { color: var(--dim); }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .grid-4, .stats { grid-template-columns: repeat(2, 1fr); }
  footer.site .cols { grid-template-columns: repeat(2, 1fr); }
  .next { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { width: min(var(--wrap), 100% - 2rem); }
  section { padding: 3.5rem 0; }
  .hero { padding-top: 3rem; }
  .grid-2, .grid-3, .grid-4, .stats { grid-template-columns: 1fr; }
  .sources { columns: 1; }
  .kv { grid-template-columns: 1fr; gap: 0.1rem 0; }
  .kv dt { margin-top: 0.6rem; }
  .timeline::before { left: 0.35rem; }
  .timeline > li { padding-left: 1.75rem; }
  .timeline > li::before { left: -0.5px; }
  .timeline .when {
    position: static;
    width: auto;
    text-align: left;
    display: block;
    margin-bottom: 0.25rem;
  }
  header.site .wrap { gap: 0.75rem; }
  .mark { font-size: 0.85rem; }
  footer.site .cols { grid-template-columns: 1fr; gap: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  body::before { display: none; }
  body { background: #fff; color: #000; }
}

/* ================================================================
   THE VISUAL LAYER
   Scroll-driven and interactive components. Every animation here is
   driven either by a class the script toggles, or by a --p custom
   property the script writes through CSSOM. Nothing is set as a style
   attribute, because style-src 'self' blocks those.
   ================================================================ */

/* ------------------------------------------------------------ reveal */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 620ms cubic-bezier(0.2, 0.7, 0.3, 1), transform 620ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
html.js [data-reveal].in { opacity: 1; transform: none; }

/* --------------------------------------------------------- scrollytell */

.scrolly { position: relative; margin: 2.5rem 0 0; }
.scrolly-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start; }

.scrolly-viz {
  position: sticky;
  top: 5.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  overflow: hidden;
}
.scrolly-viz .scroller { overflow-x: auto; padding: 1rem; }
.scrolly-viz svg { display: block; width: 100%; height: auto; }
.scrolly-foot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
}
.scrolly-readout { color: var(--orange); font-weight: 700; }

.scrolly-steps { display: flex; flex-direction: column; }
.scrolly-step {
  border-left: 2px solid var(--line);
  padding: 1.25rem 0 1.25rem 1.5rem;
  margin: 0;
  min-height: 42vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: border-color 300ms ease, opacity 300ms ease;
  opacity: 0.45;
}
.scrolly-step.on { border-left-color: var(--orange); opacity: 1; }
.scrolly-step .n {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
  display: block;
  margin-bottom: 0.4rem;
}
.scrolly-step.on .n { color: var(--orange); }
.scrolly-step h3 { margin-bottom: 0.5rem; }
.scrolly-step p { color: var(--dim); font-size: 0.95rem; max-width: 46ch; }
/* Without JavaScript the steps are just a readable column, at full strength. */
html:not(.js) .scrolly-step { opacity: 1; min-height: 0; }
html:not(.js) .scrolly-viz { position: static; }

/* ------------------------------------------------------- anonymity grid */

.anon-stage { position: relative; }
.anon-links {
  position: absolute;
  inset: 0.9rem;
  width: calc(100% - 1.8rem);
  height: calc(100% - 1.8rem);
  pointer-events: none;
  overflow: visible;
}
.anon-link {
  stroke: var(--red);
  stroke-width: 1;
  opacity: 0;
  animation: linkIn 420ms ease forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes linkIn { to { opacity: 0.42; } }
.anon-hub { fill: var(--red); opacity: 0.9; }
.anon-grid i.found { background: var(--mint); }
.anon-grid i.mine, .anon-grid i.found { animation: cellPop 340ms cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes cellPop { from { transform: scale(0.2); } to { transform: scale(1); } }

.anon-num { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; }
.anon-num.bad { color: var(--red); }
.anon-num.good { color: var(--mint); }
.anon-readout {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
}

/* ---------------------------------------------------------- decoder */

.decoder { margin: 2rem 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.decoder-str {
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.9;
  word-break: break-all;
  padding: 1.25rem;
  background: var(--sunken);
  border-bottom: 1px solid var(--line);
}
.decoder-str span {
  padding: 0.15rem 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease;
}
.decoder-str [data-seg="hrp"] { color: var(--orange); border-bottom-color: rgba(247, 147, 26, 0.4); }
.decoder-str [data-seg="sep"] { color: var(--faint); }
.decoder-str [data-seg="ver"] { color: var(--violet); border-bottom-color: rgba(167, 139, 250, 0.4); }
.decoder-str [data-seg="scan"] { color: var(--mint); border-bottom-color: rgba(79, 214, 176, 0.35); }
.decoder-str [data-seg="spend"] { color: #ffd08a; border-bottom-color: rgba(255, 208, 138, 0.35); }
.decoder-str [data-seg="sum"] { color: var(--dim); border-bottom-color: var(--line-hi); }
.decoder-str span.on { background: rgba(255, 255, 255, 0.09); color: var(--fg); }
.decoder-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.decoder-key button {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--line-hi);
  border-radius: 2px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
}
.decoder-key button:hover { color: var(--fg); border-color: var(--dim); }
.decoder-note {
  padding: 1rem 1.25rem;
  font-size: 0.92rem;
  color: var(--dim);
  max-width: none;
  min-height: 5.5rem;
}
.decoder-note strong { color: var(--fg); }
.decoder-note code { color: var(--orange); }

/* -------------------------------------------------------- range input */

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: transparent;
  padding: 0;
  border: 0;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  background: var(--line-hi);
  border-radius: 2px;
}
input[type="range"]::-moz-range-track { height: 3px; background: var(--line-hi); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6.5px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid var(--void);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid var(--void);
}
input[type="range"]:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }

/* ------------------------------------------------------------- calc */

.calc { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); margin: 2rem 0; }
.calc-head { padding: 1.25rem 1.25rem 0.5rem; }
.calc-head label { margin: 0; }
.calc-head .val {
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: -0.03em;
}
.calc-slide { padding: 0.25rem 1.25rem 1rem; }
.calc-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--faint);
  margin-top: -0.25rem;
}
.calc-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}
.calc-facts div { background: var(--panel); padding: 0.85rem 1.25rem; }
.calc-facts .k {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
  display: block;
}
.calc-facts .v {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
  display: block;
  margin-top: 0.2rem;
}
.calc-rows { padding: 1.1rem 1.25rem 1.25rem; display: grid; gap: 0.9rem; }
.calc-row { display: grid; grid-template-columns: 12rem 1fr 6rem; gap: 0.9rem; align-items: center; }
.calc-row .lbl { font-family: var(--mono); font-size: 0.78rem; color: var(--dim); }
.calc-row .lbl small { display: block; color: var(--faint); font-size: 0.68rem; }
.calc-row .track { height: 12px; background: var(--sunken); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.calc-row .fill {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: var(--orange);
  border-radius: 0 2px 2px 0;
  transition: width 320ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
.calc-row.gpu .fill { background: var(--mint); }
.calc-row .num { font-family: var(--mono); font-size: 0.85rem; color: var(--fg); text-align: right; }
.calc-foot {
  padding: 0 1.25rem 1.25rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
  line-height: 1.7;
}
.calc-foot a { color: var(--faint); }

/* ------------------------------------------------------- attack sim */

.sim { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); margin: 2rem 0; overflow: hidden; }
.sim-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--dim);
}
.sim-bar .spacer { flex: 1; }
.sim-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.sim-lane { background: var(--panel); padding: 1.25rem; }
.sim-head { font-family: var(--mono); font-size: 0.76rem; color: var(--dim); margin-bottom: 1.1rem; line-height: 1.6; }
.sim-head strong { display: block; color: var(--fg); font-size: 0.86rem; margin-bottom: 0.2rem; }

.sim-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.4rem 0 0.6rem;
}
.sim-track::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 2.5rem;
  height: 1px;
  background: var(--line-hi);
}
.sim-node {
  position: relative;
  z-index: 2;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--dim);
  background: var(--panel);
  border: 1px solid var(--line-hi);
  border-radius: 2px;
  padding: 0.3rem 0.5rem;
  white-space: nowrap;
}
.sim-node.attacker { color: var(--red); border-color: var(--red); }
.sim-rail { position: absolute; left: 8%; right: 8%; top: 2.5rem; height: 1px; }
.sim-packet {
  position: absolute;
  top: -5px;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--dim);
  opacity: 0;
}
.sim-stage.run .sim-packet { animation: packet 3s cubic-bezier(0.45, 0, 0.55, 1) forwards; }
@keyframes packet {
  0% { left: 0; opacity: 0; background: var(--dim); transform: none; }
  5% { opacity: 1; }
  44% { left: calc(100% - 11px); background: var(--dim); }
  50% { left: calc(100% - 11px); background: var(--red); transform: scale(1.5); }
  56% { left: calc(100% - 11px); background: var(--red); transform: none; }
  97% { left: 0; background: var(--red); opacity: 1; }
  100% { left: 0; background: var(--red); opacity: 1; }
}
.sim-stage.done .sim-packet { opacity: 1; background: var(--red); left: 0; }
.sim-stage.run .sim-node.attacker { animation: flash 700ms 1.35s ease; }
@keyframes flash {
  0%, 100% { background: var(--panel); }
  50% { background: rgba(255, 95, 82, 0.28); }
}

.sim-out {
  margin-top: 1rem;
  border-radius: var(--r);
  border: 1px solid var(--line);
  padding: 0.85rem 0.95rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.sim-stage.run .sim-out { transition-delay: 3s; }
.sim-stage.run .sim-out, .sim-stage.done .sim-out { opacity: 1; transform: none; }
.sim-lane.bad .sim-out { border-color: var(--red); color: var(--red); background: rgba(255, 95, 82, 0.06); }
.sim-lane.good .sim-out { border-color: var(--mint); color: var(--mint); background: rgba(79, 214, 176, 0.06); }
.sim-out b { display: block; font-size: 0.8rem; margin-bottom: 0.25rem; }
.sim-out span { color: var(--dim); display: block; word-break: break-all; }

/* ------------------------------------------------------ cost compare */

.compare-rows { display: grid; gap: 0.9rem; padding: 1.1rem 1.25rem 1.25rem; }
.compare-row { display: grid; grid-template-columns: 13rem 1fr 7rem; gap: 0.9rem; align-items: center; }
.compare-row .lbl { font-family: var(--mono); font-size: 0.8rem; color: var(--fg); }
.compare-row .lbl small { display: block; color: var(--faint); font-size: 0.68rem; margin-top: 0.1rem; }
.compare-row .track { height: 14px; background: var(--sunken); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.compare-row .fill {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  background: var(--red);
  transition: width 340ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
.compare-row.free .fill { background: var(--mint); }
.compare-row .num { font-family: var(--mono); font-size: 0.85rem; color: var(--fg); text-align: right; }
.compare-row.free .num { color: var(--mint); }

/* ---------------------------------------------------------- waffle */

.waffle {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7px, 1fr));
  gap: 2px;
  margin: 1.25rem 0;
}
.waffle i { display: block; aspect-ratio: 1; background: #1b2026; border-radius: 1px; }
/* The highlighted squares are red by default, so a reader with no scripting,
   or a printed page, still sees the proportion. Only when there is a script to
   animate them do they start dim and fill in. */
.waffle i.hit { background: var(--red); }
html.js .waffle:not(.in) i.hit { background: #1b2026; }
html.js .waffle.in i.hit { transition: background-color 300ms ease; transition-delay: var(--d, 0ms); }

/* ------------------------------------------------- timeline progress */

.timeline { --p: 0; }
.timeline::after {
  content: "";
  position: absolute;
  left: 7.5rem;
  top: 0.5rem;
  width: 1px;
  height: calc((100% - 1rem) * var(--p));
  background: linear-gradient(to bottom, var(--orange), rgba(247, 147, 26, 0.25));
}

/* ------------------------------------------------ horizontal bar chart */

.c-row { fill: var(--orange); }
.c-row-dim { fill: #3a4048; }
.chart svg.growing [data-grow-x] { transition: width 620ms cubic-bezier(0.2, 0.7, 0.3, 1); }
.c-rlbl { font-family: var(--mono); font-size: 10px; fill: var(--dim); }
.c-rval { font-family: var(--mono); font-size: 10px; fill: var(--fg); }

/* -------------------------------------------------- small multiples */

.multiples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0; }
.multiple {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 1.1rem;
  text-align: center;
}
.multiple .yr {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--faint);
  text-transform: uppercase;
}
.multiple svg { display: block; width: 100%; height: auto; margin: 0.5rem 0; }
.multiple .pc { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; color: var(--orange); letter-spacing: -0.03em; }
.multiple .sub { font-size: 0.78rem; color: var(--dim); margin: 0.2rem 0 0; max-width: none; }
.ring-bg { fill: none; stroke: #262c33; stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--orange); stroke-width: 9; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }

/* ------------------------------------------------------- responsive */

@media (max-width: 980px) {
  .scrolly-inner { grid-template-columns: 1fr; gap: 0; }
  .scrolly-viz { top: 3.6rem; margin-bottom: 1.5rem; }
  .scrolly-viz .scroller { padding: 0.6rem; }
  .scrolly-step { min-height: 34vh; }
  .sim-stage { grid-template-columns: 1fr; }
  .multiples { grid-template-columns: 1fr; }
  .calc-facts { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .calc-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .calc-row .num { text-align: left; }
  .compare-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .compare-row .num { text-align: left; }
  .timeline::after { left: 0.35rem; }
  .decoder-str { font-size: 0.78rem; }
  .sim-node { font-size: 0.6rem; padding: 0.25rem 0.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .anon-link { opacity: 0.42; animation: none; }
  .sim-stage .sim-out { opacity: 1; transform: none; }
  .waffle i.hit { background: var(--red); }
}

/* --------------------------------------------------- scrolly slide deck
 * Eight full-panel slides stacked on top of each other, one visible at a
 * time. Without JavaScript they are not stacked at all: they flow down the
 * page as eight ordinary figures, which is a perfectly good fallback and the
 * reason the diagrams are separate SVGs rather than layers of one.
 */
.scrolly-slides > .slide { border-bottom: 1px solid var(--line); }
.scrolly-slides > .slide:last-child { border-bottom: 0; }
.scrolly-slides svg { display: block; width: 100%; height: auto; }

html.js .scrolly-slides { position: relative; aspect-ratio: 640 / 440; }
html.js .scrolly-slides > .slide {
  position: absolute;
  inset: 0;
  border: 0;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}
html.js .scrolly-slides > .slide.on { opacity: 1; pointer-events: auto; }

.scrolly-dots { display: flex; gap: 4px; }
.scrolly-dot {
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--line-hi);
  transition: background-color 260ms ease;
}
.scrolly-dot.on { background: var(--orange); }

@media (max-width: 980px) {
  html.js .scrolly-slides { aspect-ratio: 640 / 460; }
}

/* --------------------------------------------------- slide typography
 * The slide deck runs at a 640 unit viewBox in a roughly 540px column, so
 * everything is about 0.85 scale on a desktop. These sizes are chosen to
 * land above 11px after that, which is the floor for reading hex.
 */
.s-title { font-family: var(--mono); font-size: 15px; font-weight: 700; fill: var(--fg); letter-spacing: -0.3px; }
.s-big { font-family: var(--mono); font-size: 20px; font-weight: 700; fill: var(--fg); letter-spacing: -0.5px; }
.s-t { font-family: var(--mono); font-size: 14px; fill: var(--fg); }
.s-sm { font-family: var(--mono); font-size: 12px; fill: var(--dim); }
.s-mono { font-family: var(--mono); font-size: 10.5px; fill: var(--dim); }

/* Before the observer has chosen a step, show the first slide rather than a
   blank panel. */
html.js .scrolly-slides > .slide:first-child { opacity: 1; }
html.js .scrolly.js .scrolly-slides > .slide:first-child { opacity: 0; }
html.js .scrolly.js .scrolly-slides > .slide.on { opacity: 1; }

/* Only the machine-readable line may break mid-token. Prose in the same box
   should wrap like prose. */
.sim-out span { word-break: normal; overflow-wrap: break-word; }
.sim-out span.addr-line { word-break: break-all; }
/* At rest the packet sits just clear of the wallet node, carrying the answer
   it was handed, so a still frame still tells the story. */
.sim-stage.done .sim-packet { opacity: 1; background: var(--red); left: 14%; }

/* ---------------------------------------------- scrollytelling on a phone
 * A sticky panel beside a scrolling column needs two columns, and a phone has
 * one. Rather than shrink a 640 unit diagram into a 358 pixel viewport and
 * call it responsive, the deck comes apart below 900px: each slide flows
 * inline at full width with its own explanation directly underneath.
 *
 * The interleaving is done with display:contents plus order, so the markup
 * stays in the shape that makes sense on a desktop and for a screen reader.
 */
@media (max-width: 900px) {
  html.js .scrolly-inner { display: flex; flex-direction: column; gap: 0; }
  html.js .scrolly-viz,
  html.js .scrolly-steps,
  html.js .scrolly-slides { display: contents; }
  html.js .scrolly-foot { display: none; }

  html.js .scrolly-slides { aspect-ratio: auto; }
  html.js .scrolly-slides > .slide {
    position: static;
    opacity: 1;
    pointer-events: auto;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--panel);
    margin-top: 2.5rem;
    overflow: hidden;
  }
  html.js .scrolly-slides > .slide:first-child { opacity: 1; }
  html.js .scrolly.js .scrolly-slides > .slide:first-child,
  html.js .scrolly.js .scrolly-slides > .slide { opacity: 1; }

  html.js .scrolly-step {
    min-height: 0;
    opacity: 1;
    border-left: 0;
    border-top: 2px solid var(--orange);
    padding: 1rem 0 0;
    margin-bottom: 0.5rem;
  }
  html.js .scrolly-step .n { color: var(--orange); }

  /* slide n, then step n, then slide n+1 */
  html.js .scrolly-slides > .slide:nth-child(1) { order: 1; }
  html.js .scrolly-steps > .scrolly-step:nth-child(1) { order: 2; }
  html.js .scrolly-slides > .slide:nth-child(2) { order: 3; }
  html.js .scrolly-steps > .scrolly-step:nth-child(2) { order: 4; }
  html.js .scrolly-slides > .slide:nth-child(3) { order: 5; }
  html.js .scrolly-steps > .scrolly-step:nth-child(3) { order: 6; }
  html.js .scrolly-slides > .slide:nth-child(4) { order: 7; }
  html.js .scrolly-steps > .scrolly-step:nth-child(4) { order: 8; }
  html.js .scrolly-slides > .slide:nth-child(5) { order: 9; }
  html.js .scrolly-steps > .scrolly-step:nth-child(5) { order: 10; }
  html.js .scrolly-slides > .slide:nth-child(6) { order: 11; }
  html.js .scrolly-steps > .scrolly-step:nth-child(6) { order: 12; }
  html.js .scrolly-slides > .slide:nth-child(7) { order: 13; }
  html.js .scrolly-steps > .scrolly-step:nth-child(7) { order: 14; }
  html.js .scrolly-slides > .slide:nth-child(8) { order: 15; }
  html.js .scrolly-steps > .scrolly-step:nth-child(8) { order: 16; }

  /* A 640 unit diagram in a narrow column means everything shrinks, so the
     type inside the slides is stepped up to compensate. */
  .s-title { font-size: 18px; }
  .s-big { font-size: 23px; }
  .s-t { font-size: 16.5px; }
  .s-sm { font-size: 14px; }
  .s-mono { font-size: 11.5px; }

  /* The rings are decoration at 300px. Cap them. */
  .multiple svg { max-width: 168px; margin-inline: auto; }
}

@media (max-width: 900px) {
  /* A 640 unit drawing squeezed into a 390px phone puts body text at eight
     pixels. Give each slide a floor and let it pan sideways, the same deal
     every other diagram on the site makes. */
  html.js .scrolly-slides > .slide { overflow-x: auto; }
  html.js .scrolly-slides > .slide svg { min-width: 480px; }
  .s-mono { font-size: 12px; }
}

/* ------------------------------------------------------ reading progress */

.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; }
.progress i {
  display: block;
  height: 100%;
  width: calc(var(--sp, 0) * 100%);
  background: var(--orange);
  transition: width 90ms linear;
}

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

.hero-grid { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 3.5rem; align-items: start; }
.readout {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  overflow: hidden;
  margin-top: 2.5rem;
}
.readout-bar {
  padding: 0.6rem 1rem;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.readout-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0 1rem;
  margin: 0;
  padding: 0.9rem 1rem;
  font-family: var(--mono);
  font-size: 0.8rem;
}
.readout-body dt { color: var(--dim); padding: 0.25rem 0; }
.readout-body dd { margin: 0; padding: 0.25rem 0; text-align: right; }
.readout-body dd.bad { color: var(--red); }
.readout-body dd.good { color: var(--mint); }
.readout-body dd.warnish { color: var(--orange); }
.readout-split {
  padding: 0.55rem 1rem;
  border-block: 1px solid var(--line);
  background: var(--sunken);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
}
.readout-foot {
  padding: 0.85rem 1rem 1rem;
  font-size: 0.82rem;
  color: var(--faint);
  max-width: none;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------- explorer mock */

.explorer {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  overflow: hidden;
  margin: 2rem 0;
}
.explorer-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
}
.explorer-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; }
.explorer-addr {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.82rem;
  word-break: break-all;
  color: var(--red);
}
.explorer-addr span {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.3rem;
}
.ex-rows { display: grid; }
.ex-row {
  display: grid;
  grid-template-columns: 1fr auto 8rem;
  gap: 1rem;
  align-items: baseline;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.ex-row .k { color: var(--dim); }
.ex-row .v { color: var(--fg); text-align: right; }
.ex-row .w { color: var(--red); font-size: 0.72rem; text-align: right; }
.ex-row .w.soft { color: var(--orange); }
.explorer-foot {
  padding: 0.9rem 1rem;
  font-size: 0.86rem;
  color: var(--dim);
  max-width: none;
  background: var(--sunken);
}
.explorer-foot strong { color: var(--mint); }

/* -------------------------------------------- scroll-filled DNSSEC chain */

.chain-step { opacity: clamp(0, calc((var(--p, 1) - var(--t, 0)) * 7), 1); }
.cs1 { --t: 0.02; }
.cs2 { --t: 0.14; }
.cs3 { --t: 0.26; }
.cs4 { --t: 0.38; }
.cs5 { --t: 0.5; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 0; }
  .readout { margin-top: 2.5rem; }
}
@media (max-width: 760px) {
  .ex-row { grid-template-columns: 1fr auto; }
  .ex-row .w { grid-column: 1 / -1; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .chain-step { opacity: 1; }
}

/* The hero headline shares its row with the readout panel, so it gets a
   smaller ceiling than a full-width headline would. */
.hero-grid h1 { font-size: clamp(1.9rem, 4.1vw, 2.85rem); }
@media (max-width: 980px) {
  .hero-grid h1 { font-size: clamp(2rem, 5.2vw, 3.5rem); }
}
