Files
bitlogin/packages/demo/public/assets/site.css
thePR0M3TH3ANandClaude Fable 5 7d2209d706 Second-audit hardening: phrase-gated sudo key, deterministic migration, policy tests
Authored by ChatGPT/Codex in a separate review pass. Reviewed and verified
here before committing rather than taken on trust; findings below.

The substantive change is that the vault sudo key now lives ONLY in the
phrase-gated recovery capsule. A newly written password credential capsule
carries just connection_vault_root, so an ordinary login restores
connectable-tier records without putting personal-tier material behind a
password capsule that is downloadable and therefore offline-guessable forever.
Pre-hardening capsules stay readable, password login does not return their
sudo key, and the next rotation scrubs it. That closes the gate this project
had explicitly set on personal-tier UI.

Legacy vault-enable migration now derives roots deterministically from
phrase-protected material and account_id, so two concurrent attempts cannot
mint divergent roots -- the failure mode the docs previously mitigated with
"enable the vault once, from one device".

Manual (user-chosen) passwords are REMOVED, not merely discouraged, and a new
securityPolicy.test.ts pins that along with several things tests do not
usually reach: the deployment CSP (default-src 'none', frame-ancestors
'none') plus six baseline headers, demo pages free of inline scripts and
remote fonts, and README documenting same-origin self-hosting only rather
than a remote demo embed. llms.txt was updated to match, which I checked
because that test only reads README.

What I verified, since a passing suite proves less than it appears to:

- All 12 fixes from the 2026-07-30 audit survived the rewrite of recover.ts,
  changePassword.ts, validation.ts, relay.ts, session.ts and element.ts.
  Checked semantically where grep cannot help: changePassword still checks
  publish success BEFORE building the tombstone, and vaultSetBinding still
  unbinds on origin === null rather than silently rebinding to the worker
  global.
- No dependency changes; the package.json diff is scripts only.
- Argon2id and KDF parameters unchanged. The NIP-44 diff ADDS a base64 length
  cap before decoding, a memory-DoS guard.
- Validation increased rather than decreased: 44 throws added, 33 removed.
- No disabled or skipped tests, no secrets in the diff.

typecheck clean, 165/165 tests, build green, and the account manager exercised
in a browser: creation correctly refused when relay quorum could not be met,
and on retry failed at the recovery capsule with "No login credential was
published" -- the §18.1 fail-closed ordering doing its job against a flaky
public relay set.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CMr9Yt8SYmZcfgrg3CV2G1
2026-07-31 13:54:36 -04:00

453 lines
13 KiB
CSS

:root {
--ink: #0d0b12;
--ink-soft: #17141f;
--ink-softer: #201c2b;
--paper: #f3ead9;
--paper-dim: #e8dcc2;
--seal: #8368ff;
--seal-deep: #6a4de8;
--brass: #d1a85a;
--brass-soft: #9c824f;
--fg: #f4f1ea;
--muted: #a49cb0;
--line: rgba(244, 241, 234, 0.11);
--line-strong: rgba(244, 241, 234, 0.2);
--code-bg: #100e17;
--shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
--font-display: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
color-scheme: dark;
}
@media (prefers-color-scheme: light) {
:root {
--ink: #f7f2e7;
--ink-soft: #ffffff;
--ink-softer: #efe8d8;
--paper: #ffffff;
--paper-dim: #efe8d8;
--seal: #6a4de8;
--seal-deep: #5638c9;
--brass: #9c7a2e;
--brass-soft: #b3924a;
--fg: #211c2c;
--muted: #675f75;
--line: rgba(33, 28, 44, 0.12);
--line-strong: rgba(33, 28, 44, 0.22);
--code-bg: #211c2c;
color-scheme: light;
}
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
background:
radial-gradient(1100px 620px at 82% -10%, color-mix(in srgb, var(--seal) 16%, transparent), transparent 60%),
radial-gradient(900px 500px at -10% 15%, color-mix(in srgb, var(--brass) 10%, transparent), transparent 55%),
var(--ink);
color: var(--fg);
font-family: var(--font-body);
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
a { color: var(--seal); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible {
outline: 2px solid var(--brass);
outline-offset: 3px;
border-radius: 4px;
}
/* ---------- nav ---------- */
.nav {
display: flex;
align-items: center;
justify-content: space-between;
max-width: 1120px;
margin: 0 auto;
padding: 22px 24px;
}
.nav .brand {
display: flex;
align-items: center;
color: var(--fg);
}
/* Icon + wordmark are one fixed SVG (assets/lockup.svg) with their relative size and
spacing baked in, so the lockup looks identical everywhere it's used -- callers only
ever set a single height, never size the mark and the wordmark independently. */
.nav .brand .lockup {
height: 21px;
width: auto;
display: block;
}
.nav .links { display: flex; gap: 26px; font-size: 14px; }
.nav .links a { color: var(--muted); }
.nav .links a.active, .nav .links a:hover { color: var(--fg); text-decoration: none; }
.nav .links a.active { position: relative; }
.nav .links a.active::after {
content: "";
position: absolute;
left: 0; right: 0; bottom: -8px;
height: 2px;
background: var(--brass);
border-radius: 2px;
}
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
/* ---------- hero ---------- */
.hero {
padding: 56px 24px 24px;
}
.hero-grid {
display: grid;
grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
gap: 56px;
align-items: center;
max-width: 1120px;
margin: 0 auto;
}
@media (max-width: 900px) {
.hero-grid { grid-template-columns: 1fr; gap: 40px; }
}
.eyebrow {
display: inline-flex;
align-items: center;
gap: 8px;
font-size: 12.5px;
font-weight: 600;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--brass);
margin-bottom: 18px;
}
.eyebrow::before {
content: "";
width: 7px; height: 7px;
border-radius: 50%;
background: var(--brass);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--brass) 25%, transparent);
}
.hero h1 {
font-family: var(--font-display);
font-size: clamp(38px, 5.4vw, 68px);
font-weight: 600;
letter-spacing: -0.02em;
line-height: 1.02;
margin: 0 0 22px;
color: var(--fg);
}
.hero h1 em {
font-style: italic;
color: var(--seal);
}
.hero p.lead {
color: var(--muted);
font-size: 17.5px;
max-width: 480px;
margin: 0 0 30px;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 13px 24px;
border-radius: 11px;
font-weight: 600;
font-size: 14.5px;
border: 1px solid var(--line-strong);
transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn.primary {
background: linear-gradient(160deg, var(--seal), var(--seal-deep));
color: #ffffff;
border: none;
box-shadow: 0 12px 28px color-mix(in srgb, var(--seal) 35%, transparent);
}
.btn.primary:hover { transform: translateY(-1px); text-decoration: none; }
.btn.secondary { color: var(--fg); }
.btn.secondary:hover { background: var(--ink-soft); text-decoration: none; transform: translateY(-1px); }
/* ---------- signature visual: one credential, many doors ---------- */
.credential-scene {
position: relative;
display: grid;
gap: 14px;
justify-items: stretch;
}
.credential-card {
position: relative;
background: linear-gradient(155deg, var(--paper), var(--paper-dim));
color: #241d12;
border-radius: 16px;
padding: 20px 22px;
box-shadow: var(--shadow);
border: 1px solid color-mix(in srgb, var(--brass) 40%, transparent);
z-index: 2;
}
.credential-card .cc-top {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 12px;
}
.credential-card .cc-seal {
width: 30px; height: 30px;
border-radius: 50%;
background: linear-gradient(155deg, var(--seal), var(--seal-deep));
display: flex; align-items: center; justify-content: center;
flex-shrink: 0;
box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35);
}
.credential-card .cc-seal svg { width: 15px; height: 15px; }
.credential-card .cc-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #6b5a34; font-weight: 700; }
.credential-card .cc-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.credential-card .cc-id {
font-family: var(--font-mono);
font-size: 11.5px;
color: #6b5a34;
letter-spacing: 0.01em;
word-break: break-all;
}
.door-rail {
position: relative;
background: var(--ink-soft);
border: 1px solid var(--line);
border-radius: 16px;
padding: 8px;
display: grid;
gap: 4px;
z-index: 1;
}
.door-row {
display: flex;
align-items: center;
gap: 12px;
padding: 10px 12px;
border-radius: 11px;
}
.door-row .door-icon {
width: 30px; height: 30px;
border-radius: 8px;
background: var(--ink-softer);
border: 1px solid var(--line);
display: flex; align-items: center; justify-content: center;
flex-shrink: 0;
color: var(--muted);
}
.door-row .door-icon svg { width: 16px; height: 16px; }
.door-row .door-label { font-size: 13.5px; color: var(--fg); font-weight: 550; flex: 1; }
.door-row .door-stamp {
width: 22px; height: 22px;
border-radius: 50%;
border: 1.5px solid var(--line-strong);
display: flex; align-items: center; justify-content: center;
flex-shrink: 0;
color: transparent;
background: transparent;
animation: stamp-in 0.5s ease-out both;
animation-delay: calc(var(--stamp-order, 0) * 0.32s + 0.5s);
}
.door-row .door-stamp svg { width: 12px; height: 12px; }
@keyframes stamp-in {
0% { transform: scale(1.7); border-color: var(--line-strong); color: transparent; background: transparent; }
55% { transform: scale(0.92); }
70% { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 22%, transparent); color: var(--brass); }
100% { transform: scale(1); border-color: var(--brass); background: color-mix(in srgb, var(--brass) 22%, transparent); color: var(--brass); }
}
@media (prefers-reduced-motion: reduce) {
.door-row .door-stamp {
animation: none;
border-color: var(--brass);
background: color-mix(in srgb, var(--brass) 22%, transparent);
color: var(--brass);
}
}
.credential-scene .scene-caption {
text-align: center;
font-size: 12.5px;
color: var(--muted);
padding-top: 2px;
}
/* ---------- compare section ---------- */
.compare-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 16px;
margin: 36px 0 8px;
}
@media (max-width: 800px) {
.compare-grid { grid-template-columns: 1fr; }
}
.compare-card {
background: var(--ink-soft);
border: 1px solid var(--line);
border-radius: 16px;
padding: 22px;
}
.compare-card h3 { margin: 0 0 4px; font-size: 15.5px; font-family: var(--font-display); font-weight: 600; }
.compare-card .compare-kicker { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin-bottom: 6px; display: block; }
.compare-card p { margin: 0; color: var(--muted); font-size: 13.5px; }
.compare-card.is-bitlogin {
background: linear-gradient(165deg, color-mix(in srgb, var(--seal) 16%, var(--ink-soft)), var(--ink-soft));
border-color: color-mix(in srgb, var(--brass) 55%, var(--line));
box-shadow: 0 18px 40px color-mix(in srgb, var(--seal) 18%, transparent);
transform: translateY(-6px);
}
@media (max-width: 800px) {
.compare-card.is-bitlogin { transform: none; }
}
.compare-card.is-bitlogin .compare-kicker { color: var(--brass); }
.compare-card.is-bitlogin p { color: var(--fg); opacity: 0.85; }
/* ---------- diagram (kept for docs/account pages) ---------- */
.diagram {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
flex-wrap: wrap;
margin: 48px 0;
font-size: 13.5px;
}
.diagram .step {
background: var(--ink-soft);
border: 1px solid var(--line);
border-radius: 12px;
padding: 14px 16px;
min-width: 140px;
text-align: center;
}
.diagram .step .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.diagram .arrow { color: var(--brass); font-size: 18px; }
/* ---------- feature grid ---------- */
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
gap: 16px;
margin: 40px 0;
}
.feature {
background: var(--ink-soft);
border: 1px solid var(--line);
border-radius: 14px;
padding: 20px;
transition: border-color 0.15s ease, transform 0.15s ease;
}
.feature:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.feature h3 { margin: 0 0 8px; font-size: 15.5px; font-family: var(--font-display); font-weight: 600; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }
/* Six cards in a grid that's four columns wide leaves a lopsided 4+2 last row --
pin that row's two cards under the middle two columns instead of the left two. */
@media (min-width: 860px) {
.grid-center-last-row { grid-template-columns: repeat(4, 1fr); }
.grid-center-last-row .feature:nth-child(5) { grid-column: 2 / 3; }
.grid-center-last-row .feature:nth-child(6) { grid-column: 3 / 4; }
}
section { padding: 20px 0 40px; }
h2 {
font-family: var(--font-display);
font-size: 30px;
font-weight: 600;
letter-spacing: -0.01em;
margin: 0 0 6px;
}
p.section-sub { color: var(--muted); margin: 0 0 28px; max-width: 620px; }
pre {
background: var(--code-bg);
color: #ece8f5;
border: 1px solid var(--line);
border-radius: 12px;
padding: 18px;
overflow-x: auto;
font-size: 13px;
line-height: 1.55;
}
code { font-family: var(--font-mono); }
:not(pre) > code {
background: var(--ink-soft);
border: 1px solid var(--line);
border-radius: 5px;
padding: 1px 5px;
font-size: 0.92em;
}
.step-list { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step-list > li {
counter-increment: step;
position: relative;
padding: 0 0 28px 44px;
border-left: 2px solid var(--line);
margin-left: 15px;
}
.step-list > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.step-list > li::before {
content: counter(step);
position: absolute;
left: -15px;
top: 0;
width: 28px; height: 28px;
border-radius: 50%;
background: linear-gradient(155deg, var(--seal), var(--seal-deep));
color: white;
font-weight: 700;
font-size: 13px;
display: flex;
align-items: center;
justify-content: center;
}
.step-list h3 { margin: 2px 0 8px; font-size: 16px; font-family: var(--font-display); font-weight: 600; }
.callout {
border: 1px solid var(--line);
background: var(--ink-soft);
border-radius: 12px;
padding: 14px 16px;
font-size: 13.5px;
color: var(--muted);
margin: 18px 0;
}
.callout strong { color: var(--fg); }
.app-layout {
display: flex;
justify-content: center;
padding: 48px 24px 80px;
gap: 40px;
}
.app-layout .side {
max-width: 340px;
}
.app-layout .side h1 {
font-family: var(--font-display);
font-size: 30px;
font-weight: 600;
margin: 0 0 10px;
letter-spacing: -0.01em;
}
.app-layout .side p { color: var(--muted); font-size: 14px; }
@media (max-width: 820px) {
.app-layout { flex-direction: column; align-items: center; gap: 24px; }
.app-layout .side { max-width: 460px; text-align: center; }
}
footer {
border-top: 1px solid var(--line);
padding: 28px 24px;
text-align: center;
color: var(--muted);
font-size: 13px;
}
footer .footer-links {
margin-top: 8px;
}