diff --git a/CONTINUITY.md b/CONTINUITY.md index 5c86006..18c516d 100644 --- a/CONTINUITY.md +++ b/CONTINUITY.md @@ -35,10 +35,15 @@ reference is [CLAUDE.md](CLAUDE.md); the phase plan is [ROADMAP.md](ROADMAP.md). copies the local ledger to S3 (refuses unless keys match). Schedules: sweeps every 6 h staggered (amazon :00 … flaring :40), analyst :50, export +1 h. Alarm email: me@marcsperzel.com. Check `state/heartbeat.json` in the state bucket. -3. **Naming is open**: Marc rejected `vitalearth.io` (registered 2026-09-26, $71/yr — drop it - or keep as redirect; check the refund window). `vital.earth` is taken. Do NOT register - anything without showing him the exact name + price first (memory: ask-before-purchases). - Brand strings live in `src/site.config.ts` (name, full name, tagline, base URL). +3. **Domain + name**: the site is served at **https://vitalearth.io** (registered 2026-09-26, + $71/yr, refund refused by AWS, auto-renew OFF; Marc dislikes the name but uses it since + it's paid). The public name is the neutral **"Earth Watch"** (`src/site.config.ts`); + "Vital Earth" is a taken trademark. **The site is anonymous**: no owner name, email or + GitHub handle anywhere (test in `test/site-export.test.ts` fails on any); right of reply + has no channel yet (a forwarding mailbox on the domain is a follow-up). Do NOT register + or buy anything without showing Marc the exact item + price first. IPv6 is disabled on + CloudFront on purpose (AAAA-only resolver answers broke the fresh domain on IPv6-less + networks); Tailscale MagicDNS on Marc's Mac negative-cached the name for an hour. 4. **Next build steps**: (a) attribution onto cases in `created.context` (`protected_areas` + `emitters`); (b) `emitters` as the methane confirmer while EMIT is stale; (c) `ledger verify --remote ` (the case pages already print it); (d) GEE: Marc creates the GCP diff --git a/docs/screenshots/site-case-top.jpg b/docs/screenshots/site-case-top.jpg new file mode 100644 index 0000000..c11f60d Binary files /dev/null and b/docs/screenshots/site-case-top.jpg differ diff --git a/docs/screenshots/site-developers.jpg b/docs/screenshots/site-developers.jpg new file mode 100644 index 0000000..d99444a Binary files /dev/null and b/docs/screenshots/site-developers.jpg differ diff --git a/docs/screenshots/site-landing-v2-mobile.jpg b/docs/screenshots/site-landing-v2-mobile.jpg new file mode 100644 index 0000000..9185ec9 Binary files /dev/null and b/docs/screenshots/site-landing-v2-mobile.jpg differ diff --git a/docs/screenshots/site-landing-v2.jpg b/docs/screenshots/site-landing-v2.jpg new file mode 100644 index 0000000..77b2517 Binary files /dev/null and b/docs/screenshots/site-landing-v2.jpg differ diff --git a/infra/earthdeck.yaml b/infra/earthdeck.yaml index b7d67f2..7a69147 100644 --- a/infra/earthdeck.yaml +++ b/infra/earthdeck.yaml @@ -169,7 +169,9 @@ Resources: Comment: earthdeck Earth Watch Enabled: true HttpVersion: http2and3 - IPV6Enabled: true + # IPv4 only: some resolvers returned AAAA-only for the fresh domain and networks without an + # IPv6 route then fail with "address unreachable" (observed 2026-09-26). No AAAA record either. + IPV6Enabled: false PriceClass: PriceClass_100 DefaultRootObject: index.html Aliases: [!Ref DomainName] @@ -276,17 +278,6 @@ Resources: HostedZoneId: !FindInMap [Const, CloudFront, HostedZoneId] EvaluateTargetHealth: false - DnsAAAA: - Type: AWS::Route53::RecordSet - Properties: - HostedZoneId: !Ref HostedZoneId - Name: !Ref DomainName - Type: AAAA - AliasTarget: - DNSName: !GetAtt Distribution.DomainName - HostedZoneId: !FindInMap [Const, CloudFront, HostedZoneId] - EvaluateTargetHealth: false - # ── runner: Lambda ──────────────────────────────────────────────────────────────────── RunnerLogGroup: Type: AWS::Logs::LogGroup @@ -385,7 +376,7 @@ Resources: EARTHDECK_DISTRIBUTION_ID: !Ref Distribution EARTHDECK_SSM_PREFIX: /earthdeck EARTHDECK_SITE_URL: !Sub "https://${DomainName}" - EARTHDECK_CONTACT: !Ref NotifyEmail + # No EARTHDECK_CONTACT: the public site is anonymous — no personal email is ever exported. NODE_OPTIONS: --enable-source-maps Tags: [{ Key: Project, Value: earthdeck }] diff --git a/scripts/deploy.sh b/scripts/deploy.sh index f75a864..1e38bde 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -18,8 +18,8 @@ PROFILE=${AWS_PROFILE:-personal} REGION=us-east-1 STACK=earthdeck EXPECTED_ACCOUNT=185692190330 -DOMAIN=${EARTHDECK_DOMAIN:-vital.marcsperzel.com} -HOSTED_ZONE_ID=Z00187933CPH1RMT9RKHT +DOMAIN=${EARTHDECK_DOMAIN:-vitalearth.io} +HOSTED_ZONE_ID=${EARTHDECK_HOSTED_ZONE_ID:-Z07362552JHZID1QJ2DSR} NOTIFY_EMAIL=me@marcsperzel.com SSM_PREFIX=/earthdeck SECRETS=(GFW_API_KEY CDSE_CLIENT_ID CDSE_CLIENT_SECRET FIRMS_MAP_KEY ANTHROPIC_API_KEY) diff --git a/src/site.config.ts b/src/site.config.ts index 32cdd0b..69a45aa 100644 --- a/src/site.config.ts +++ b/src/site.config.ts @@ -2,6 +2,9 @@ // public URL live. `earthdeck watch export` renders every page title, meta description, // canonical URL, Open Graph / Twitter card, JSON-LD block and the sitemap from this object. // Rename here, re-export, done. ("earthdeck" stays only where it names the CLI/npm package.) +// +// The public site is anonymous: no person's name, email, handle or personal hostname goes in +// here or anywhere else the export renders (test/site-export.test.ts greps the output). export const SITE = { /** Wordmark and short name: header, page-title suffix, og:site_name. */ @@ -10,22 +13,22 @@ export const SITE = { fullName: "Earth Watch", /** Small label after the wordmark in the header. */ byline: "Earth’s vital signs", - /** Hero headline, one entry per line. */ + /** Landing page title, after the name. */ tagline: ["The planet’s vital signs —", "and the value of being alive."] as const, - /** One-line positioning under the headline, and the default meta description. */ + /** The landing's one sentence (its h1), next to the wordmark — the only prose above the fold. Plain words. */ + oneLine: "Satellites watch the planet. Our AI checks what it sees, gets a second opinion, and publishes what holds up. Anyone can check the evidence.", + /** Default meta description (landing, JSON-LD). */ description: "An autonomous, evidence-backed watch on Earth’s living systems: forest loss, fires in protected land, methane and gas flaring — every case published with evidence anyone can verify against a signed, append-only ledger.", /** * Public origin used for canonical URLs, og:url/og:image, JSON-LD and sitemap.xml when - * `--base-url` isn’t passed. (Domain still being decided — change it here or pass --base-url.) + * `--base-url` isn’t passed. */ - baseUrl: "https://vital.marcsperzel.com", + baseUrl: "https://vitalearth.io", /** The publisher, for JSON-LD `Organization`. */ - organization: { name: "Vital Earth", url: "https://vital.marcsperzel.com" }, - /** Where issues (right of reply, false positives) are filed, and the footer credit link. */ - repo: "https://github.com/marcoloco23/earthdeck", - /** Footer credit for the engine underneath. */ - credit: "built on earthdeck", + organization: { name: "Earth Watch", url: "https://vitalearth.io" }, + /** Footer credit. */ + credit: "Built on open data", /** Static social card, relative to the site root (1200×630; carries no product name). */ ogImage: "og.png", /** diff --git a/src/watch/export.ts b/src/watch/export.ts index 7ff43df..fc860ea 100644 --- a/src/watch/export.ts +++ b/src/watch/export.ts @@ -8,6 +8,7 @@ // ledger/{checkpoint,pub,entries.jsonl,tile/**} — the verification surface // api/stats.json counts + published false-positive rate per rule // api/pulse.json world_pulse snapshot (fresh, else cached, else omitted) +// developers/index.html verify-it-yourself commands, feeds, API, schema (kept off the landing) // schema/finding-event.v1.json, trust.html (+ TRUST.md), sitemap.xml, robots.txt // assets/**, og.png the built site bundle (dist/site, `pnpm build`) // @@ -23,7 +24,7 @@ import { PUBLIC_STATUSES, STATUSES, type Finding, type Status } from "../ledger/ import { ledgerDir as defaultLedgerDir } from "../config.js"; import { SITE } from "../site.config.js"; import { readHeartbeat, type Heartbeat } from "./journal.js"; -import { casePage, FALLBACK_TEMPLATE, fillTemplate, landingPage, robots, sitemap, trustPage, watchIndexPage, type CaseData, type Ctx } from "./site-render.js"; +import { casePage, developersPage, FALLBACK_TEMPLATE, fillTemplate, landingPage, robots, sitemap, trustPage, watchIndexPage, type CaseData, type Ctx } from "./site-render.js"; const PKG_ROOT = fileURLToPath(new URL("../../", import.meta.url)); // dist/watch → root, src/watch → root const MARKER = ".earthdeck-site"; @@ -53,7 +54,8 @@ export interface RateCell { export interface SiteStats { generatedAt: string; - site: { name: string; baseUrl: string | null; repo: string; contact: string | null; trust: boolean }; + /** `contact` is always null: the public site is anonymous (no address, no repo link). */ + site: { name: string; baseUrl: string | null; contact: null; trust: boolean }; ledger: { size: number; root: string | null; checkpoint: string | null }; lastSweep: Heartbeat | null; cases: { total: number; public: number; confirmed: number; candidates: number; falsePositives: number }; @@ -82,7 +84,7 @@ export function computeStats( findings: readonly Finding[], ledger: { size: number; root: string | null; checkpoint: string | null }, lastSweep: Heartbeat | null, - site: { baseUrl?: string | null; contact?: string | null; trust?: boolean } = {}, + site: { baseUrl?: string | null; trust?: boolean } = {}, now = new Date(), ): SiteStats { const byStatus = Object.fromEntries(STATUSES.map((s) => [s, 0])) as Record; @@ -119,7 +121,7 @@ export function computeStats( for (const r of Object.values(byRule)) r.versions.sort(); return { generatedAt: now.toISOString(), - site: { name: SITE.name, baseUrl: site.baseUrl ?? null, repo: SITE.repo, contact: site.contact ?? null, trust: site.trust ?? false }, + site: { name: SITE.name, baseUrl: site.baseUrl ?? null, contact: null, trust: site.trust ?? false }, ledger, lastSweep, cases: { @@ -146,7 +148,7 @@ export interface ExportOptions { ledgerDir?: string; /** Public origin for canonical/OG/JSON-LD/sitemap. Default SITE.baseUrl; null = none (no sitemap). */ baseUrl?: string | null; - /** Right-of-reply email shown on case pages (mailto). */ + /** Accepted for compatibility (the runner passes it) and ignored: the public site is anonymous. */ contact?: string; /** Built site bundle (index.html template, assets/, og.png). Default dist/site; null = unstyled fallback. */ siteDir?: string | null; @@ -223,7 +225,7 @@ export async function exportSite(opts: ExportOptions): Promise { findings, { size: ledger?.size ?? 0, root: ledger ? ledger.root().toString("hex") : null, checkpoint: ledger?.checkpointText() ?? null }, readHeartbeat(join(lDir, "watch")), - { baseUrl, contact: opts.contact ?? null, trust }, + { baseUrl, trust }, now, ); write("api/stats.json", JSON.stringify(stats)); @@ -248,7 +250,8 @@ export async function exportSite(opts: ExportOptions): Promise { // ---- pages ---- const ctx = (depth: number, path: string): Ctx => ({ depth, path, baseUrl, stats }); const published = findings.filter((f) => PUBLIC_STATUSES.includes(f.status)); - write("index.html", fillTemplate(tpl, 0, "landing", landingPage(ctx(0, ""), published))); + write("index.html", fillTemplate(tpl, 0, "landing", landingPage(ctx(0, ""), findings))); + write("developers/index.html", fillTemplate(tpl, 1, "developers", developersPage(ctx(1, "developers/")))); write("watch/index.html", fillTemplate(tpl, 1, "watch", watchIndexPage(ctx(1, "watch/"), findings))); for (const d of cases) { const path = `watch/case/${d.finding.findingId}/`; @@ -266,6 +269,7 @@ export async function exportSite(opts: ExportOptions): Promise { const pages = [ { path: "", lastmod: stats.generatedAt }, { path: "watch/", lastmod: findings[0]?.updatedAt ?? stats.generatedAt }, + { path: "developers/" }, ...published.map((f) => ({ path: `watch/case/${f.findingId}/`, lastmod: f.updatedAt })), ...(trust ? [{ path: "trust.html" }] : []), ]; @@ -361,7 +365,7 @@ export async function runExportCli(args: string[]): Promise { if (!out) { process.stdout.write( [ - "usage: earthdeck watch export --out [--base-url https://…] [--contact email]", + "usage: earthdeck watch export --out [--base-url https://…]", " [--no-pulse | --pulse-cache ] [--trust TRUST.md] [--force]", `Writes the public ${SITE.name} site (landing + case pages + ledger + feeds) as static files.`, `--base-url defaults to ${SITE.baseUrl} (src/site.config.ts); it drives canonical URLs, og:*, JSON-LD and sitemap.xml.`, diff --git a/src/watch/site-render.ts b/src/watch/site-render.ts index 2243230..e4d9ed9 100644 --- a/src/watch/site-render.ts +++ b/src/watch/site-render.ts @@ -9,7 +9,7 @@ import { PUBLIC_STATUSES, TERMINAL_STATUSES, type Evidence, type Finding, type FindingEvent } from "../ledger/schema.js"; import { SITE } from "../site.config.js"; -import type { SiteStats, RateCell } from "./export.js"; +import { livingValueOf, type SiteStats, type RateCell } from "./export.js"; // TODO: import { GLOBAL_NATURE_VALUE } from "../clients/naturalvalue.js" once natural_value // (a3ab7a9) is on main — these are its figures (2007 US$, 2011 vs 1997 biome areas). @@ -55,11 +55,94 @@ export function formatRate(c: RateCell | undefined): string { return `${(c.rate * 100).toFixed(c.rate > 0 && c.rate < 0.1 ? 1 : 0)} % · ${c.falsePositives} of ${c.decided} decided`; } -export function issueUrl(template: "right-of-reply" | "false-positive", f: { findingId: string; title: string }, repo: string = SITE.repo): string { - const prefix = template === "right-of-reply" ? "Right of reply" : "False positive"; - return `${repo}/issues/new?template=${template}.md&title=${encodeURIComponent(clip(`${prefix}: ${f.title} (${f.findingId})`, 240))}`; +// ---- plain words (landing + top of case pages: for a general reader, no ids or jargon) ----------------- + +/** One plain status word per status. */ +export const PLAIN_STATUS: Record = { + candidate: "Being checked", + confirmed: "Being reviewed", + published: "Published", + notified: "Published", + replied: "Published", + no_response: "Published", + ignored: "Published", + resolved: "Resolved", + expired: "Couldn’t confirm", + false_positive: "Turned out wrong", + retracted: "Withdrawn", +}; +export const plainStatus = (s: string) => `${esc(PLAIN_STATUS[s] ?? words(s))}`; + +/** Friendly names for the data sources evidence cites (fallback: the raw source id). */ +const SOURCE_NAMES: [RegExp, string][] = [ + [/^gfw/, "Global Forest Watch alerts"], + [/^sentinel-2/, "Sentinel-2 satellite images"], + [/^sentinel-5p/, "Sentinel-5P satellite (methane)"], + [/^sentinel-1/, "Sentinel-1 radar images"], + [/^firms/, "NASA fire detections"], + [/^climate-trace/, "Climate TRACE facility records"], + [/nightfire|^eog/, "Gas-flare detections (VIIRS Nightfire)"], + [/^gbif/, "GBIF species records"], +]; +export const sourceName = (src: string) => SOURCE_NAMES.find(([re]) => re.test(src))?.[1] ?? src; + +/** 2 significant figures with thousands separators: 324.9 → "320", 12345 → "12,000". */ +const sig2 = (v: number) => Number(v.toPrecision(2)).toLocaleString("en-US"); + +/** Largest area (hectares) any evidence reports, or null. */ +export function areaHaOf(f: Finding): number | null { + let best: number | null = null; + for (const e of [...f.evidence, ...(f.confirmed ? [f.confirmed.signal] : [])]) { + for (const k of ["ha", "area_ha", "areaHa"]) { + const v = e.values?.[k]; + if (typeof v === "number" && Number.isFinite(v) && v > 0 && (best === null || v > best)) best = v; + } + } + return best; +} + +/** "232 hectares — about 320 football fields" (a 105 × 68 m pitch ≈ 0.714 ha). */ +export function plainArea(ha: number): string { + const fields = ha / 0.714; + const v = ha >= 10 ? Math.round(ha).toLocaleString("en-US") : String(Number(ha.toFixed(1))); + return `${v} hectare${v === "1" ? "" : "s"}${fields >= 1.5 ? ` — about ${sig2(fields)} football fields` : ""}`; +} + +/** The analyst writes `headline ⏎⏎ narrative ⏎⏎ Key numbers: … Confidence: … Caveats: …`; split it. */ +export function parseNarration(text: string): { headline: string | null; body: string; caveats: string[] } { + const lines = text.split("\n"); + const isLabel = (l: string) => /^(Key numbers|Confidence|Caveats):/.test(l.trim()); + if (!lines.some(isLabel)) return { headline: null, body: text, caveats: [] }; + const first = lines.findIndex((l) => l.trim()); + const headline = lines[first]!.replace(/^#+\s*/, "").trim() || null; + const rest = lines.slice(first + 1); + const stop = rest.findIndex(isLabel); + const body = rest.slice(0, stop < 0 ? undefined : stop).join("\n").trim(); + const ci = lines.findIndex((l) => l.trim() === "Caveats:"); + const caveats = ci < 0 ? [] : lines.slice(ci + 1).map((l) => /^\s*-\s+(.*)$/.exec(l)?.[1]).filter((x): x is string => !!x); + return { headline, body, caveats }; +} + +/** The plain headline: the narration's when present, else the finding title. */ +export const plainTitle = (f: Finding) => (f.narration ? parseNarration(f.narration.text).headline : null) ?? f.title; + +/** "Sep 2, 2026" — a date a person reads. */ +const plainDate = (iso: string) => { + const d = new Date(iso); + return Number.isNaN(d.getTime()) ? dateOf(iso) : d.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric", timeZone: "UTC" }); +}; + +/** Ledger actor ids can carry people's handles; pages never show them. */ +function plainActor(a: string): string { + if (a.startsWith("system:")) return `automatic rule ${a.slice(7).replace("@", " v")}`; + if (a.startsWith("model:")) return "AI model"; + if (a.startsWith("reviewer:")) return "a reviewer"; + return "the watch"; } +const REPLY_TEXT = + "If a case names or affects you, you can reply. A reply channel that keeps both sides on record is being set up; until then, every case page carries its ledger id so a reply can be attached to it."; + // ---- page context --------------------------------------------------------------------------------- export interface Ctx { @@ -119,18 +202,18 @@ export function head(c: Ctx, h: HeadSpec): string { const BRAND_MARK = ``; -export function siteTop(c: Ctx, current: "landing" | "cases" | "trust" | null): string { +/** The shared header. On the landing, `line` (the one sentence) sits beside the wordmark as the page's h1. */ +export function siteTop(c: Ctx, current: "landing" | "cases" | "trust" | "developers" | null, line?: string): string { const cur = (k: string) => (current === k ? ` aria-current="page"` : ""); const home = rel(c, ""); - return `
-
- ${BRAND_MARK}${esc(SITE.name)}${esc(SITE.byline)} + return `
+
+ ${BRAND_MARK}${esc(SITE.name)}${line ? "" : `${esc(SITE.byline)}`} + ${line ? `

${esc(line)}

` : ""}
`; @@ -139,7 +222,7 @@ export function siteTop(c: Ctx, current: "landing" | "cases" | "trust" | null): export function siteFoot(c: Ctx): string { const gen = c.stats.generatedAt.replace("T", " ").slice(0, 16); return `
-
+

Data sources & attributions

  • Global Forest Watch — integrated deforestation alerts, World Resources Institute. CC BY 4.0.
  • @@ -151,25 +234,13 @@ export function siteFoot(c: Ctx): string {
  • NOAA — ONI (CPC), OISST, Mauna Loa CO₂ (GML), Coral Reef Watch. U.S. Government work, public domain.
  • EOG — VIIRS Nightfire, Earth Observation Group, Payne Institute, Colorado School of Mines. Monthly and annual aggregates only.
-

${esc(SITE.fullName)} — findings are machine-generated and AI-narrated; publication requires independent confirmation and human review. ${esc(SITE.credit)} (MIT) · feed.json · stats.json · snapshot ${esc(gen)} UTC

+

${esc(SITE.fullName)} — cases are found by automatic rules on open satellite data and written up by AI; nothing is published without a second, independent signal and a review. ${esc(SITE.credit)} · ${c.stats.site.trust ? `How we decide · ` : ""}For developers · updated ${esc(gen)} UTC

`; } // ---- small pieces (mirror web/src/ui.ts + watch.ts) ------------------------------------------------------ -const TIER_HINT = [ - "Tier 0 — informational, no publication gate", - "Tier 1 — publishing needs one human approval", - "Tier 2 — publishing needs two distinct human approvals; naming a party allowed", - "Tier 3 — private notice + right-of-reply window before publication", -]; - -export const statusBadge = (s: string) => `${esc(words(s))}`; -export const tierBadge = (t: number) => { - const ok = Number.isInteger(t) && t >= 0 && t <= 3; - return `${ok ? `T${t}` : "T?"}`; -}; const time = (iso: string, text = dateOf(iso), cls = "") => `${esc(text)}`; const copyBtn = (value: string) => ``; const hash = (h: string) => `${esc(h.slice(0, 12))}…${esc(h.slice(-6))}${copyBtn(h)}`; @@ -177,9 +248,13 @@ const cmdline = (cmd: string, attrs = "") => `

${esc(title)}${count !== undefined ? `${esc(count)}` : ""}

${body}`; +/** A case in plain words: status word, date, headline, then place · size · value of nature at stake. */ function caseRow(f: Finding, href: string, cls = ""): string { - const meta = [f.aoi?.name ?? f.aoi?.id, `${f.rule.name}@${f.rule.version}`, `${f.evidence.length + (f.confirmed ? 1 : 0)} evidence`].filter(Boolean).join(" · "); - return `${statusBadge(f.status)}${tierBadge(f.tier)}${time(f.updatedAt, dateOf(f.updatedAt), "case-when")}${esc(f.title)}${esc(meta)}`; + const ha = areaHaOf(f); + const lv = livingValueOf(f); + const meta = [f.aoi?.name, ha !== null ? plainArea(ha) : "", lv !== null ? `nature’s work worth ≈ ${fmtUsd(lv)} a year` : ""].filter(Boolean).join(" · "); + const title = plainTitle(f); + return `${plainStatus(f.status)}${time(f.updatedAt, plainDate(f.updatedAt), "case-when")}${esc(title)}${meta ? `${esc(meta)}` : ""}`; } // ---- markdown-lite (TRUST.md, narration) ------------------------------------------------------------------- @@ -257,107 +332,137 @@ export function renderMarkdown(md: string, headingOffset = 0): string { // ---- landing ------------------------------------------------------------------------------------------------- -export function landingPage(c: Ctx, published: Finding[]): { head: string; body: string } { +export function landingPage(c: Ctx, findings: Finding[]): { head: string; body: string } { const s = c.stats; - const base = c.baseUrl ?? "https://"; - const site = c.baseUrl ?? SITE.repo; + const site = c.baseUrl ?? SITE.organization.url; const orgId = `${site}#org`; const ld = [ - { "@context": "https://schema.org", "@type": "Organization", "@id": orgId, name: SITE.organization.name, url: c.baseUrl ?? SITE.organization.url, sameAs: [SITE.repo] }, + { "@context": "https://schema.org", "@type": "Organization", "@id": orgId, name: SITE.organization.name, url: c.baseUrl ?? SITE.organization.url }, { "@context": "https://schema.org", "@type": "WebSite", name: SITE.fullName, alternateName: SITE.name, url: abs(c, "") ?? undefined, description: SITE.description, publisher: { "@id": orgId } }, datasetLd(c, orgId), ]; - const dots = published + const isPub = (f: Finding) => PUBLIC_STATUSES.includes(f.status); + // What's live: published cases plus the open ones still being checked or reviewed. + const live = findings.filter((f) => isPub(f) || f.status === "candidate" || f.status === "confirmed"); + const latest = [...live].sort((a, b) => b.updatedAt.localeCompare(a.updatedAt)).slice(0, 6); + const nPub = live.filter(isPub).length; + + // Markers: plain links positioned over an equirectangular image, so lon/lat → % is linear. + const pct = (v: number) => Math.min(100, Math.max(0, v)).toFixed(2); + const pins = [...live] + .sort((a, b) => Number(isPub(a)) - Number(isPub(b))) // published drawn last, on top .map((f) => { const [w, so, e, n] = f.bbox; - const x = ((w + e) / 2 + 180).toFixed(2); - const y = (90 - (so + n) / 2).toFixed(2); - return `${esc(f.title)}`; + const x = (((w + e) / 2 + 180) / 360) * 100; + const y = ((90 - (so + n) / 2) / 180) * 100; + const cls = ["pin", isPub(f) ? "pin--pub" : "pin--open", y < 18 ? "pin--below" : "", x < 14 ? "pin--l" : x > 86 ? "pin--r" : ""].filter(Boolean).join(" "); + const title = plainTitle(f); + return ``; }) .join(""); + const rows = latest.length + ? latest.map((f) => `
  • ${caseRow(f, `watch/case/${f.findingId}/`, `live-row${isPub(f) ? "" : " is-unpublished"}`)}
  • `).join("") + : `
  • No cases yet — the first check hasn’t found anything.
  • `; + const fp = s.falsePositiveRate.overall; - const fpV = fp.rate === null ? "n/a" : `${(fp.rate * 100).toFixed(fp.rate > 0 && fp.rate < 0.1 ? 1 : 0)} %`; - const kpi = (k: string, v: string, sub: string, title = "", cls = "") => - `
    ${esc(k)}
    ${v}
    ${sub}
    `; - const sweep = s.lastSweep - ? kpi("Last sweep", time(s.lastSweep.at, dateOf(s.lastSweep.at), "ago"), esc(s.lastSweep.at.replace("T", " ").slice(0, 16) + " UTC"), `Sweep ${s.lastSweep.sweepId}`) - : kpi("Last sweep", "—", `site built ${esc(dateOf(s.generatedAt))}`); - const rootK = s.ledger.root - ? kpi("Ledger root", `${esc(s.ledger.root.slice(0, 10))}…${copyBtn(s.ledger.root)}`, `${s.ledger.size} signed entries`, "", " kpi--root") - : kpi("Ledger root", "empty", "no entries yet", "", " kpi--root"); - const latest = published.length - ? published.slice(0, 6).map((f) => caseRow(f, `watch/case/${f.findingId}/`)).join("") - : `

    Nothing has passed confirmation and review yet. Every candidate is still listed — marked unpublished — in the cases index.

    `; - - const body = `${siteTop(c, "landing")} -
    -
    -

    Open planetary monitoring

    -

    ${SITE.tagline.map(esc).join("
    ")}

    -

    ${esc(SITE.description)}

    -

    An AI writes up what the sweep finds; the ledger refuses to publish anything that skipped independent confirmation or human review — and anyone can re-check it without trusting us.

    - -
    -
    -
    - The Earth at night (NASA Black Marble) with the locations of ${published.length} published case${published.length === 1 ? - ${dots} -
    ${published.length ? `${published.length} published case${published.length === 1 ? "" : "s"}` : "No published cases yet"}NASA Black Marble via GIBS
    -
    -
    -
    - ${kpi("Published cases", String(s.cases.public), "passed confirmation + review")} - ${kpi("Independently confirmed", String(s.cases.confirmed), `of ${s.cases.total} finding${s.cases.total === 1 ? "" : "s"} in the ledger`)} - ${kpi("False-positive rate", fpV, fp.rate === null ? "no decided findings yet" : `${fp.falsePositives} of ${fp.decided} decided`, s.falsePositiveRate.definition)} - ${s.livingValue ? kpi("Living value", `≈ ${esc(fmtUsd(s.livingValue.usdPerYear))}/yr`, `value of nature at stake in ${s.livingValue.cases} open case${s.livingValue.cases === 1 ? "" : "s"}, USD/yr, order of magnitude`, s.livingValue.definition, " kpi--living") : ""} - ${sweep} - ${rootK} + const num = (v: string, k: string, title = "") => `
    ${esc(k)}
    ${v}
    `; + const wrongTitle = fp.decided ? `${fp.falsePositives} of the ${fp.decided} cases we could settle turned out wrong. We keep them on the site.` : "No case has been settled yet."; + const flow: [string, string][] = [ + ["Spot", "satellites flag a change"], + ["Double-check", "a second, separate source must agree"], + ["Review", "a reviewer reads the evidence"], + ["Warn first", "the people named hear first"], + ["Keep the record", "nothing is edited or deleted"], + ]; + + const body = `${siteTop(c, "landing", SITE.oneLine)} +
    +
    +
    +
    +
    +
    + The Earth at night with the places of ${nPub} published case${nPub === 1 ? +
    ${pins}
    +
    +
    +
    PublishedBeing checkedEarth at night · NASA
    +
    +
    + ${num(String(s.cases.public), "Cases published")} + ${num(fp.decided ? `${fp.falsePositives} of ${fp.decided}` : "0", "Times we were wrong", wrongTitle)} + ${num(s.lastSweep ? time(s.lastSweep.at, plainDate(s.lastSweep.at), "ago") : "—", "Last check", s.lastSweep ? `${s.lastSweep.at.replace("T", " ").slice(0, 16)} UTC` : "")} +
    +
    +
    +

    Latest cases

    All cases →
    +
      ${rows}
    +
    -

    Nature does ≈ $${GLOBAL_NATURE_VALUE.usdPerYear.low / 1e12}–${GLOBAL_NATURE_VALUE.usdPerYear.high / 1e12} trillion a year of work for us — more than global GDP. ${esc(GLOBAL_NATURE_VALUE.source)}

    -
    -

    How a case is made

    -

    A rule decides what counts as a finding. The AI explains it. The ledger refuses to publish anything that skipped a step.

    -
      -
    1. 01

      Detect

      Deterministic rules sweep watched places with open data — forest alerts, active fires, methane columns, flares. A rule fires; a candidate opens with its evidence.

    2. -
    3. 02

      Verify

      A candidate stays unpublished until an independent second signal — another sensor, provider or a later revisit — confirms it. Unconfirmed candidates expire.

    4. -
    5. 03

      Attribute

      Assets and institutions, never people — and only through a cited registry, with two human reviewers before any party is named.

    6. -
    7. 04

      Route

      The case goes to whoever can act on it. High-stakes cases get a 72-hour private notice and a right of reply before they are public.

    8. -
    9. 05

      Track

      Replies, resolutions, corrections and false positives are new signed events. Nothing is edited. Nothing is deleted.

    10. -
    +
    +

    How a case is made

    +
      ${flow.map(([k, v], i) => `
    1. ${i + 1}${esc(k)}${esc(v)}
    2. `).join("")}
    -
    -

    Latest published cases

    All cases →
    -
    ${latest}
    + -
    + ${siteFoot(c)}`; + return { + head: head(c, { title: `${SITE.fullName} — ${SITE.tagline.join(" ")}`, description: SITE.description, jsonld: ld }), + body, + }; +} + +/** For developers: every command, feed and machine-readable link the landing leaves out. */ +export function developersPage(c: Ctx): { head: string; body: string } { + const s = c.stats; + const base = c.baseUrl ?? "https://"; + const r = (p: string) => rel(c, p); + const link = (p: string, label: string, what: string) => `
  • ${esc(label)}${esc(what)}
  • `; + const body = `${siteTop(c, "developers")} +
    +
    +

    For developers

    +

    Verify it yourself, pull the data feeds, read the schema. No account and no trust in this website needed.

    +
    + ${section( + "Verify it yourself", + `

    The ledger is a transparency log: every event is signed (DSSE, Ed25519), hashed into an RFC 6962 Merkle tree and sealed by a signed checkpoint. Three commands:

    1. Mirror the log

      The raw entries, the signed checkpoint and the public key — static files on this site.

      ${cmdline(`mkdir ew && cd ew && curl -sf --remote-name-all ${base}/ledger/entries.jsonl ${base}/ledger/checkpoint && curl -sf ${base}/ledger/pub -o ledger.pub`, c.baseUrl ? "" : ' data-base-cmd=""')}
    2. Re-derive everything

      Checks every signature, the canonical form of every entry, every trust rule (no publication without confirmation and review), and that the root matches the checkpoint.

      ${cmdline("EARTHDECK_LEDGER_DIR=. npx -y earthdeck ledger verify")}
    3. Prove history wasn’t rewritten

      Keep today’s checkpoint. Next time, check that the new log extends it — a consistency proof, not a promise.

      ${cmdline("EARTHDECK_LEDGER_DIR=. npx -y earthdeck ledger verify --trusted ../saved-checkpoint")}
    -

    Machine-readable: feed.json · feed.geojson · stats.json · event schema · checkpoint

    -
    -
    -

    How to challenge

    -
    -

    Right of reply

    If a case names or affects you, reply. Your reply is recorded as a signed event and shown verbatim on the case page, next to the evidence. Every case page has a button that opens a pre-filled request.

    -

    Report a false positive

    Think a case is wrong? Tell us why. If it is, it becomes a false positive — publicly, forever — and counts against its rule’s published false-positive rate.

    -
    -
    ${challengeButtons(s, null)}
    -
    +
    ${s.ledger.root ? `
    Signed root
    ${hash(s.ledger.root)}
    ` : ""}
    Entries
    ${esc(s.ledger.size)}
    `, + undefined, + "verify", + )} + ${section( + "Data feeds & API", + ``, + )} + ${section("Source code", `

    Source code: coming.

    `)} +

    Every case page also carries its own inclusion proof, checked in your browser, under “Technical details”.

    ${siteFoot(c)}`; - return { - head: head(c, { title: `${SITE.fullName} — ${SITE.tagline.join(" ")}`, description: SITE.description, jsonld: ld }), - body, - }; + return { head: head(c, { title: `For developers · ${SITE.name}`, description: "Verify every Earth Watch case yourself: the signed ledger, three commands, data feeds, API and schema." }), body }; } function datasetLd(c: Ctx, orgId: string): Record { @@ -382,19 +487,6 @@ function datasetLd(c: Ctx, orgId: string): Record { }; } -function challengeButtons(s: SiteStats, f: Finding | null): string { - const repo = s.site.repo; - const reply = f ? issueUrl("right-of-reply", f, repo) : `${repo}/issues/new?template=right-of-reply.md`; - const fp = f ? issueUrl("false-positive", f, repo) : `${repo}/issues/new?template=false-positive.md`; - const contact = s.site.contact && /^[^\s@<>"']+@[^\s@<>"']+$/.test(s.site.contact) ? s.site.contact : null; - const subject = encodeURIComponent(f ? `Right of reply: ${f.title} (${f.findingId})` : `${SITE.name}: right of reply`); - return [ - `Right of reply`, - `Report a false positive`, - contact ? `Email ${esc(contact)}` : "", - ].join(""); -} - // ---- cases index ---------------------------------------------------------------------------------------------- export function watchIndexPage(c: Ctx, findings: Finding[]): { head: string; body: string } { @@ -402,7 +494,7 @@ export function watchIndexPage(c: Ctx, findings: Finding[]): { head: string; bod const isPublic = (f: Finding) => PUBLIC_STATUSES.includes(f.status); const pub = findings.filter(isPublic); const rows = findings.map((f) => `
  • ${caseRow(f, `case/${f.findingId}/`)}
  • `).join(""); - const orgId = `${c.baseUrl ?? SITE.repo}#org`; + const orgId = `${c.baseUrl ?? SITE.organization.url}#org`; const crumbs = c.baseUrl ? { "@context": "https://schema.org", @@ -442,6 +534,12 @@ export function watchIndexPage(c: Ctx, findings: Finding[]): { head: string; bod } // ---- case page --------------------------------------------------------------------------------------------------- +// +// Top of the page is for anyone: headline, the plain write-up, a map, what we saw / what it might +// not be / what would change our mind, why it was (not) published, and how to reply. Everything +// technical — rule, ids, evidence methods, history, the proof — sits in a closed "Technical +// details" block at the bottom. Actor ids from the ledger (which can carry people's handles) are +// never rendered; they stay in the ledger files for verification only. export interface CaseData { finding: Finding; @@ -451,11 +549,15 @@ export interface CaseData { const MAIN_PATH = ["candidate", "confirmed", "published", "notified", "resolved"]; const NOT_PUBLIC: Record = { - candidate: "a candidate — one signal, still waiting for an independent second one", - confirmed: "confirmed by an independent second signal and waiting for human review", - expired: "expired — no independent confirmation arrived in time", - false_positive: "a false positive — reviewers ruled the signal out", + candidate: "Not published yet: only one source has seen this so far. We wait for a second, separate one before anything goes up.", + confirmed: "Not published yet: a second, separate source agreed, and it is now waiting for a reviewer.", + expired: "Never published: no second source confirmed it in time, so it was dropped — but it stays on this site.", + false_positive: "Never published: on a closer look it turned out wrong. It stays on this site so mistakes are counted, not hidden.", }; +const CHANGE_MIND = + "Newer satellite images that show no change, a correction from the data source, or a reply with evidence from the ground. If that happens, the case is marked “Turned out wrong” — in public — and it stays on this site."; +const NOT_SURE_DEFAULT = + "Satellite signals can be wrong: clouds, smoke, the seasons and sensor glitches can all look like change. That is why every case needs a second, separate source before it is published."; export function casePage(c: Ctx, d: CaseData): { head: string; body: string } { const f = d.finding; @@ -465,50 +567,74 @@ export function casePage(c: Ctx, d: CaseData): { head: string; body: string } { const published = pubEv?.at; const where = f.aoi?.name ?? f.aoi?.id; const [w, so, e, n] = f.bbox; + const nar = f.narration ? parseNarration(f.narration.text) : null; + const title = plainTitle(f); + + // What we saw: size and value in words, then each piece of evidence by its source's plain name. + const ha = areaHaOf(f); + const lv = livingValueOf(f); + const allEv = [...f.evidence, ...(f.confirmed ? [f.confirmed.signal] : [])]; + const seen = [ + ...(ha !== null ? [`
  • Area: ${esc(plainArea(ha))}
  • `] : []), + ...(lv !== null ? [`
  • Nature’s work at stake: about ${esc(fmtUsd(lv))} a year (a rough estimate of what this land does for people — clean water, carbon, food).
  • `] : []), + ...allEv.map((x) => { + const href = safeUrl(x.href); + return `
  • ${esc(sourceName(x.source))}${x.summary ? ` — ${esc(x.summary)}` : ""} (${esc(plainDate(x.datetime))})${href ? ` See the source ↗` : ""}
  • `; + }), + ]; + const doubts = [...(nar?.caveats ?? []), ...(f.blindSpots ?? [])]; + const replies = rightOfReplyHtml(f); + // Technical details (collapsed). const facts: [string, string][] = [ ["Rule", `${f.rule.name} v${f.rule.version}`], + ["Tier", `T${f.tier}`], ...(f.aoi?.tags?.length ? ([["Tags", f.aoi.tags.join(", ")]] as [string, string][]) : []), ["Confirmed", f.confirmed ? `Yes — independent ${f.confirmed.independence} signal, ${dateOf(f.confirmed.at)}` : "Not yet — single signal"], ...(f.attribution ? ([["Subject", `${f.attribution.subject.kind}: ${f.attribution.subject.name}`]] as [string, string][]) : []), ...(f.attribution?.party ? ([["Party", `${f.attribution.party.name} (via ${f.attribution.party.registry.name}; ${f.attribution.reviewers.length} reviewers)`]] as [string, string][]) : []), ["Rule FP rate", formatRate(s.falsePositiveRate.byRule[f.rule.name])], ["Location", `${fmtLat((so + n) / 2)} ${fmtLon((w + e) / 2)}`], + ["Observed", dateOf(f.observedAt)], + ["Opened", `${dateOf(f.createdAt)} by ${plainActor(f.createdBy)}`], ]; - const ev = [...f.evidence.map((x) => evidenceHtml(x, false)), ...(f.confirmed ? [evidenceHtml(f.confirmed.signal, true)] : [])]; + const ev = allEv.map((x, i) => evidenceHtml(x, i >= f.evidence.length)); const ctxHtml = contextHtml(f); - const replies = rightOfReplyHtml(f); - const hist = [...f.history].reverse().map((h) => tl(h.at, `${words(h.kind)} → ${words(h.status)}`, h.actor)).join(""); + const hist = [...f.history].reverse().map((h) => tl(h.at, `${words(h.kind)} → ${words(h.status)}`, plainActor(h.actor))).join(""); const body = `${siteTop(c, "cases")}
    - ${heroHtml(f)}
    -
    ${statusBadge(f.status)}${tierBadge(f.tier)}
    -

    ${esc(f.title)}

    -

    ${[where ? esc(where) : "", `observed ${time(f.observedAt)}`, published ? `published ${time(published)}` : `opened ${time(f.createdAt)}`, `by ${esc(f.createdBy)}`].filter(Boolean).join(" · ")}

    +
    ${plainStatus(f.status)}
    +

    ${esc(title)}

    +

    ${[where ? esc(where) : "", `seen ${time(f.observedAt, plainDate(f.observedAt))}`, published ? `published ${time(published, plainDate(published))}` : ""].filter(Boolean).join(" · ")}

    -

    ${esc(f.summary)}

    - ${isPublic ? "" : ``} - ${f.retracted ? `` : ""} - ${f.narration ? `
    ${renderMarkdown(f.narration.text, 1)}

    AI-drafted by ${esc(f.narration.model.id)}, ${f.narration.reviewedBy ? `reviewed by ${esc(f.narration.reviewedBy)}` : "not yet human-reviewed"}. Every claim cites evidence below.

    ` : ""} - ${stepperHtml(f)} -
    ${facts.map(([k, v]) => `
    ${esc(k)}
    ${esc(v)}`).join("")}
    - ${section("Evidence", ev.join(""), ev.length)} - ${ctxHtml ? section("Context", ctxHtml) : ""} - ${f.blindSpots?.length ? section("Blind spots", `

    What this rule cannot see — read the finding with these in mind.

      ${f.blindSpots.map((b) => `
    • ${esc(b)}
    • `).join("")}
    `, f.blindSpots.length) : ""} - ${section(isPublic ? "Why this was published" : "Why this is not published", whyHtml(f, pubEv))} - ${replies ? section("Right of reply", replies) : ""} - ${section("Challenge this finding", `

    Named in this finding, affected by it, or think it’s wrong? Replies are recorded in the ledger and shown verbatim on this page. Corrections are new signed events — never silent edits.

    ${challengeButtons(s, f)}
    `, undefined, "challenge")} - ${section("History", `
      ${hist}
    `, f.history.length)} - ${section("Verify", verifyHtml(c, d), undefined, "verify")} + ${nar ? `
    ${renderMarkdown(nar.body, 1)}

    Written by AI, then checked by a separate reviewer before publication. Every claim points at the evidence below.

    ` : `

    ${esc(f.summary)}

    `} + ${isPublic ? "" : ``} + ${f.retracted ? `` : ""} + ${heroHtml(f)} + ${section("What we saw", `
      ${seen.join("")}
    `)} + ${section("What it might not be", doubts.length ? `
      ${doubts.map((b) => `
    • ${esc(b)}
    • `).join("")}
    ` : `

    ${esc(NOT_SURE_DEFAULT)}

    `)} + ${section("What would change our mind", `

    ${esc(CHANGE_MIND)}

    `)} + ${section(isPublic ? "Why this was published" : "Why this is not published", `

    ${esc(whySentence(f, pubEv))}

    `)} + ${section("Right of reply", `${replies}

    ${esc(REPLY_TEXT)}

    Ledger id ${esc(f.findingId)}${copyBtn(f.findingId)}

    `, undefined, "challenge")} +
    + Technical details rule, evidence ids, history, proof +
    ${facts.map(([k, v]) => `
    ${esc(k)}
    ${esc(v)}`).join("")}
    + ${stepperHtml(f)} + ${section("Evidence", ev.join(""), ev.length)} + ${ctxHtml ? section("Context", ctxHtml) : ""} + ${section("Publication gates", whyHtml(f, pubEv))} + ${section("History", `
      ${hist}
    `, f.history.length)} + ${section("Verify", verifyHtml(c, d), undefined, "verify")} +
    ${siteFoot(c)}`; - const orgId = `${c.baseUrl ?? SITE.repo}#org`; + const orgId = `${c.baseUrl ?? SITE.organization.url}#org`; const geo = f.geometry.type === "Point" ? { "@type": "GeoCoordinates", latitude: f.geometry.coordinates[1], longitude: f.geometry.coordinates[0] } : { "@type": "GeoShape", box: `${so} ${w} ${n} ${e}` }; @@ -526,7 +652,7 @@ export function casePage(c: Ctx, d: CaseData): { head: string; body: string } { publisher: { "@type": "Organization", "@id": orgId, name: SITE.organization.name, url: SITE.organization.url }, about: { "@type": "Place", name: where ?? `${fmtLat((so + n) / 2)} ${fmtLon((w + e) / 2)}`, geo }, keywords: [f.rule.name, ...(f.aoi?.tags ?? [])].join(", "), - isBasedOn: [...f.evidence, ...(f.confirmed ? [f.confirmed.signal] : [])].map((x) => safeUrl(x.href)).filter(Boolean), + isBasedOn: allEv.map((x) => safeUrl(x.href)).filter(Boolean), isPartOf: { "@id": `${abs(c, "watch/") ?? "watch/"}#dataset` }, ...(f.narration ? { creativeWorkStatus: isPublic ? "Published" : "Draft" } : {}), }; @@ -544,6 +670,17 @@ export function casePage(c: Ctx, d: CaseData): { head: string; body: string } { }; } +/** "Why this was published", in one plain sentence. */ +function whySentence(f: Finding, pub: FindingEvent | undefined): string { + if (f.status === "retracted") return "It was published, then withdrawn — the reason is shown above."; + if (!PUBLIC_STATUSES.includes(f.status)) return NOT_PUBLIC[f.status] ?? `Not published: ${PLAIN_STATUS[f.status] ?? words(f.status)}.`; + const first = [...new Set(f.evidence.map((x) => sourceName(x.source)))].join(" and "); + const second = f.confirmed ? sourceName(f.confirmed.signal.source) : null; + const gates = pub && pub.kind === "status_changed" ? (pub as unknown as { gates?: { reviewedBy?: unknown } }).gates : undefined; + const reviewers = Math.max(new Set(f.reviews.filter((r) => r.decision === "approve").map((r) => r.actor)).size, Array.isArray(gates?.reviewedBy) ? gates.reviewedBy.length : 0); + return `Two separate sources agreed — ${first}${second ? `, then ${second}` : ""} — and ${reviewers <= 1 ? "a reviewer" : `${reviewers} reviewers`} checked the evidence before it went up.`; +} + function heroHtml(f: Finding): string { const [w, s, e, n] = f.bbox; const cx = (w + e) / 2; @@ -615,7 +752,7 @@ function tl(at: string | null, what: string, sub: string, cls = ""): string { function rightOfReplyHtml(f: Finding): string { if (!f.notifications.length && !f.replies.length) return ""; - const items = f.notifications.map((x) => tl(x.at, `Notified ${x.to.kind} · ${x.to.name}`, `Public from ${dateOf(x.publicAt)}`)); + const items = f.notifications.map((x) => tl(x.at, `Told ${x.to.name} first`, `Public from ${plainDate(x.publicAt)}`)); items.push(...f.replies.map((r) => tl(r.receivedAt, `Reply from ${r.from}`, `“${r.text}”`, "tl--reply"))); if (f.notifications.length && !f.replies.length) items.push(tl(null, "No response recorded yet", "", "tl--waiting")); return `
      ${items.join("")}
    `; @@ -634,21 +771,22 @@ function whyHtml(f: Finding, pub: FindingEvent | undefined): string { check(f.confirmed !== null, f.confirmed ? `Independent confirmation — a different ${f.confirmed.independence} (${f.confirmed.signal.source}), ${dateOf(f.confirmed.at)}` : "Independent confirmation — not yet"), check( approvers.length >= needed, - needed === 0 ? "Human approval — not required at tier 0" : `Human approval — ${approvers.length} of ${needed} needed at tier ${f.tier}${approvers.length ? ` (${approvers.join(", ")})` : ""}`, + needed === 0 ? "Human approval — not required at tier 0" : `Human approval — ${approvers.length} of ${needed} needed at tier ${f.tier}`, ), ]; if (f.tier >= 3) { const notice = f.notifications.find((x) => x.to.kind !== "public"); items.push(check(!!notice, notice ? `Private notice to ${notice.to.name} — public from ${dateOf(notice.publicAt)}` : "Private notice + right-of-reply window — not yet")); } - if (f.narration) items.push(check(true, `Narration — AI-drafted by ${f.narration.model.id}${f.narration.reviewedBy ? `, reviewed by ${f.narration.reviewedBy}` : ""}`)); + if (f.narration) items.push(check(true, `Narration — AI-drafted by ${f.narration.model.id}${f.narration.reviewedBy ? ", reviewed by a reviewer" : ""}`)); let detail = ""; if (pub && pub.kind === "status_changed") { - const rows: [string, string][] = [["Published", `${dateOf(pub.at)} by ${pub.actor}`]]; - // `gates` is written by newer publishers; render whatever it holds, generically. + const rows: [string, string][] = [["Published", `${dateOf(pub.at)} by ${plainActor(pub.actor)}`]]; + // `gates` is written by newer publishers; render whatever it holds, generically — but + // identities (narratedBy, reviewedBy, …) only as roles: ledger actor ids stay off the page. const gates = (pub as unknown as { gates?: unknown }).gates; const g = gates && typeof gates === "object" && !Array.isArray(gates) ? (gates as Record) : {}; - for (const [k, v] of Object.entries(g)) rows.push([humanKey(k), show(v)]); + for (const [k, v] of Object.entries(g)) rows.push([humanKey(k), /By$/.test(k) ? [v].flat().map((x) => plainActor(String(x))).join(", ") : show(v)]); if (!("policy" in g) && !("policyVersion" in g)) rows.push(["Policy", "version not recorded on this event"]); if (pub.reason) rows.push(["Note", pub.reason]); detail = `
    ${rows.map(([k, v]) => `
    ${esc(k)}
    ${esc(v)}
    `).join("")}
    `; diff --git a/test/site-export.test.ts b/test/site-export.test.ts index f571749..383a748 100644 --- a/test/site-export.test.ts +++ b/test/site-export.test.ts @@ -14,7 +14,7 @@ import { seedDemo } from "../src/ledger/cli.js"; import { tilePath as nodeTilePath } from "../src/ledger/merkle.js"; import type { Finding } from "../src/ledger/schema.js"; import { computeStats, exportSite, livingValueOf } from "../src/watch/export.js"; -import { esc, fillTemplate, renderMarkdown, safeUrl } from "../src/watch/site-render.js"; +import { esc, fillTemplate, parseNarration, plainArea, renderMarkdown, safeUrl } from "../src/watch/site-render.js"; import { SITE } from "../src/site.config.js"; import { apiPaths } from "../web/src/api.js"; import { leafTile, parseCheckpoint, tilePath, verifyCheckpointSignature, verifyInclusion } from "../web/src/proof.js"; @@ -126,6 +126,20 @@ test("export writes a self-contained, relative, server-rendered site", async () const text = readFileSync(join(out, f), "utf8"); assert.ok(!/localhost|127\.0\.0\.1/.test(text), `${f} mentions a local server`); } + // The public site is anonymous: no owner name, handle, personal host, email or repo link — + // even though --contact was passed. (ledger/** is the signed log itself: base64 signatures + // could spell anything, and its bytes are what verification checks, so it is left out here.) + for (const f of files.filter((x) => /\.(html|json|geojson|xml|txt|md)$/.test(x) && !x.startsWith("ledger/"))) { + const text = readFileSync(join(out, f), "utf8"); + assert.ok(!/marc|sperzel|marcoloco|github\.com|mailto:|reply@example\.org/i.test(text), `${f} is not anonymous`); + assert.ok(!/[\w.+-]+@[\w-]+(\.[\w-]+)*\.[a-z]{2,}/i.test(text), `${f} holds an email address`); + } + // No "@" anywhere a reader sees it: rendered page bodies, stats, sitemap, robots. + for (const f of files.filter((x) => x.endsWith(".html"))) { + const html = readFileSync(join(out, f), "utf8"); + assert.ok(!html.slice(html.indexOf(" x["@type"]), ["Organization", "WebSite", "Dataset"]); assert.ok(landing.includes(`href="watch/case/${PUB_ID}/"`)); assert.ok(!landing.includes("`; assert.equal(fillTemplate(tpl, 3, "case", { head: "$&", body: "B" }), `$&B`); diff --git a/web/site/index.html b/web/site/index.html index 4e6f627..668750e 100644 --- a/web/site/index.html +++ b/web/site/index.html @@ -18,7 +18,7 @@ - + diff --git a/web/src/site/main.ts b/web/src/site/main.ts index 25b8dc0..04dffc7 100644 --- a/web/src/site/main.ts +++ b/web/src/site/main.ts @@ -12,7 +12,7 @@ import { ago } from "../ui"; import type { Card } from "../types"; const page = document.body.dataset.page ?? ""; -const DEPTH: Record = { landing: 0, trust: 0, watch: 1, case: 3 }; +const DEPTH: Record = { landing: 0, trust: 0, watch: 1, developers: 1, case: 3 }; const prefix = "../".repeat(DEPTH[page] ?? 0); const api = apiPaths("static", prefix); const siteRoot = new URL(prefix || ".", location.href).href.replace(/\/+$/, ""); @@ -51,7 +51,29 @@ for (const code of document.querySelectorAll("[data-base-cmd]")) { if (btn) btn.dataset.copy = text; } -// ---- landing: world pulse ------------------------------------------------------------------------ +// ---- landing: map ↔ list, and the world pulse ----------------------------------------------------- + +if (page === "landing") { + // Hovering a case row lights its marker, and the other way round. + const linked = [...document.querySelectorAll("[data-case]")]; + const hot = (id: string | undefined, on: boolean) => { + for (const el of linked) if (el.dataset.case === id) el.classList.toggle("is-hot", on); + }; + for (const el of linked) { + el.addEventListener("pointerenter", () => hot(el.dataset.case, true)); + el.addEventListener("pointerleave", () => hot(el.dataset.case, false)); + el.addEventListener("focus", () => hot(el.dataset.case, true)); + el.addEventListener("blur", () => hot(el.dataset.case, false)); + } + // On a phone the map is a pannable strip: start it centred on the cases, not on the Atlantic. + const strip = document.querySelector(".world-scroll"); + const pins = [...document.querySelectorAll(".pin")]; + if (strip && pins.length && strip.scrollWidth > strip.clientWidth) { + const xs = pins.map((p) => parseFloat(p.style.left) / 100); + const mid = (Math.min(...xs) + Math.max(...xs)) / 2; + strip.scrollLeft = mid * strip.scrollWidth - strip.clientWidth / 2; + } +} if (page === "landing") { void fetch(api.pulse!) @@ -68,7 +90,32 @@ if (page === "landing") { const node = renderCard(card, () => {}); node.removeAttribute("tabindex"); node.classList.add("card--static", "no-enter"); - document.getElementById("pulse")?.appendChild(node); + const box = document.getElementById("pulse"); + if (!box) return; + box.appendChild(node); + // Collapsed by default: each group header carries its own tally; "Show all" opens the tiles. + for (const g of box.querySelectorAll(".tiles-group")) { + const tiles = g.nextElementSibling; + if (!tiles?.classList.contains("tiles")) continue; + const up = tiles.querySelectorAll(".wp--improving").length; + const down = tiles.querySelectorAll(".wp--worsening").length; + const tally = document.createElement("span"); + tally.className = "tiles-tally"; + for (const [cls, text] of [["wp--improving", `▲ ${up} better`], ["wp--worsening", `▼ ${down} worse`]] as const) { + const s = document.createElement("span"); + s.className = cls; + s.textContent = text; + tally.appendChild(s); + } + g.appendChild(tally); + } + const toggle = document.querySelector(".pulse-toggle"); + toggle?.addEventListener("click", () => { + const open = toggle.getAttribute("aria-expanded") !== "true"; + toggle.setAttribute("aria-expanded", String(open)); + toggle.textContent = open ? "Show less" : "Show all"; + box.classList.toggle("is-collapsed", !open); + }); const band = document.getElementById("pulse-band"); if (band) band.hidden = false; }) diff --git a/web/src/site/site.css b/web/src/site/site.css index 36ac0cf..c611532 100644 --- a/web/src/site/site.css +++ b/web/src/site/site.css @@ -88,110 +88,116 @@ a.brand { a.btn { text-decoration: none; } -.btn--primary { - background: var(--accent); - border-color: var(--accent); - color: #04121b; - font-weight: 600; -} -.btn--lg { - height: 40px; - padding: 0 var(--s-5); - font-size: var(--fs-14); - border-radius: var(--r-3); -} -@media (hover: hover) and (pointer: fine) { - .btn--primary:hover { - background: var(--accent-strong); - border-color: var(--accent-strong); - } -} -/* ---------------------------------------------------------------- hero */ +/* ---------------------------------------------------------------- landing: header line */ -.hero { - padding-top: clamp(40px, 9vw, 96px); - padding-bottom: var(--s-8); +.wrap--wide { + max-width: 1440px; + padding-left: max(16px, env(safe-area-inset-left), 2vw); + padding-right: max(16px, env(safe-area-inset-right), 2vw); } -.eyebrow { +.top-line { + flex: 1 1 auto; + min-width: 0; margin: 0; - font-size: var(--fs-12); - font-weight: 600; - letter-spacing: 0.08em; - text-transform: uppercase; - color: var(--accent); -} -.hero-h { - margin: var(--s-3) 0 0; - font-size: clamp(2rem, 6.2vw, 3.5rem); - font-weight: 600; - line-height: 1.06; - letter-spacing: -0.035em; - color: var(--fg-1); + padding-left: var(--s-4); + border-left: 1px solid var(--line-2); + font-size: var(--fs-13); + font-weight: 400; + line-height: 1.35; + color: var(--fg-2); text-wrap: balance; } -.hero-lede { - margin: var(--s-5) 0 0; - max-width: 62ch; - font-size: clamp(var(--fs-14), 1.9vw, var(--fs-18)); - line-height: 1.6; - color: var(--fg-2); - text-wrap: pretty; +.site-top--landing .site-nav a { + padding: 4px 8px; + font-size: var(--fs-12); } -.hero-lede--sub { - margin-top: var(--s-3); - font-size: var(--fs-14); - color: var(--fg-3); + +/* ---------------------------------------------------------------- landing: live (the first screen) */ + +.live { + display: grid; + gap: var(--s-4); + padding-top: var(--s-4); } -.hero-cta { - display: flex; - flex-wrap: wrap; +.live-map { + display: grid; gap: var(--s-2); - margin-top: var(--s-6); + min-width: 0; +} +@media (min-width: 900px) { + .live { + grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); + align-items: start; + gap: var(--s-5); + } } -/* ---------------------------------------------------------------- world map */ - +/* world map: a 2:1 equirectangular image; markers are % of that box */ .world { position: relative; margin: 0; - aspect-ratio: 2 / 1; border-radius: var(--r-3); overflow: hidden; background: #04050b; border: 1px solid var(--line-1); box-shadow: var(--e-2); } +.world-scroll { + overflow-x: auto; + overflow-y: hidden; + overscroll-behavior-x: contain; + scrollbar-width: none; +} +.world-scroll::-webkit-scrollbar { + display: none; +} +.world-in { + position: relative; + width: 100%; + aspect-ratio: 2 / 1; +} .world-img { display: block; width: 100%; height: 100%; - object-fit: cover; } -.world-dots { +.pins { position: absolute; inset: 0; - width: 100%; - height: 100%; - overflow: visible; -} -.world-dots a { - cursor: pointer; } -/* Radii in map units (viewBox is 360×180 degrees, stretched to the frame). */ -.dot-core { - fill: var(--st-published); - stroke: #04050b; - stroke-width: 1px; - vector-effect: non-scaling-stroke; +.pin { + position: absolute; + width: 28px; + height: 28px; + margin: -14px 0 0 -14px; + display: grid; + place-items: center; + border-radius: 50%; + outline-offset: -4px; } -.dot-halo { - fill: none; - stroke: var(--st-published); - stroke-width: 1px; - vector-effect: non-scaling-stroke; - transform-box: fill-box; - transform-origin: center; +.pin-dot { + position: relative; + width: 8px; + height: 8px; + border-radius: 50%; + background: var(--st-candidate); + opacity: 0.75; + box-shadow: 0 0 0 2px #04050b; + transition: transform var(--dur-hover) var(--ease-out), opacity var(--dur-hover) ease; +} +.pin--pub .pin-dot { + width: 11px; + height: 11px; + background: var(--st-published); + opacity: 1; +} +.pin--pub .pin-dot::after { + content: ""; + position: absolute; + inset: -1px; + border-radius: 50%; + border: 1px solid var(--st-published); animation: ping 2.8s var(--ease-out) infinite; } @keyframes ping { @@ -200,10 +206,62 @@ a.btn { opacity: 0.9; } to { - transform: scale(4.5); + transform: scale(4); opacity: 0; } } +.pin-tip { + position: absolute; + bottom: calc(100% - 4px); + left: 50%; + z-index: 2; + max-width: 240px; + width: max-content; + padding: 4px 8px; + border-radius: var(--r-2); + background: var(--bg-3); + border: 1px solid var(--line-2); + box-shadow: var(--e-3); + font-size: var(--fs-12); + line-height: 1.35; + color: var(--fg-1); + pointer-events: none; + opacity: 0; + transform: translate(-50%, 4px); + transition: opacity var(--dur-hover) ease, transform var(--dur-hover) var(--ease-out); +} +.pin--below .pin-tip { + top: calc(100% - 4px); + bottom: auto; + transform: translate(-50%, -4px); +} +.pin--l .pin-tip { + left: 0; + transform: translate(0, 4px); +} +.pin--r .pin-tip { + left: auto; + right: 0; + transform: translate(0, 4px); +} +.pin:focus-visible .pin-tip, +.pin.is-hot .pin-tip { + opacity: 1; + transform: translate(-50%, 0); +} +.pin--l:focus-visible .pin-tip, +.pin--l.is-hot .pin-tip, +.pin--r:focus-visible .pin-tip, +.pin--r.is-hot .pin-tip { + transform: translate(0, 0); +} +.pin.is-hot { + z-index: 3; +} +.pin.is-hot .pin-dot { + transform: scale(1.5); + opacity: 1; +} .world-cap { position: absolute; left: 0; @@ -211,208 +269,273 @@ a.btn { bottom: 0; display: flex; justify-content: space-between; + align-items: center; gap: var(--s-3); - padding: 28px var(--s-4) 10px; + padding: 20px var(--s-3) 8px; background: linear-gradient(to top, rgb(4 5 11 / 0.85), transparent); font-size: var(--fs-11); color: var(--fg-3); + pointer-events: none; } -.world-cap span:first-child { - color: var(--fg-1); - font-weight: 500; +.legend { + display: inline-flex; + align-items: center; + gap: 6px; + color: var(--fg-2); +} +.lg { + width: 8px; + height: 8px; + border-radius: 50%; + background: var(--st-candidate); + opacity: 0.75; +} +.lg--pub { + background: var(--st-published); + opacity: 1; +} +.lg + .lg, +.legend .lg:not(:first-child) { + margin-left: 6px; } -/* ---------------------------------------------------------------- KPIs */ - -.kpis { +/* the three numbers */ +.nums { display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); + grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); - margin-top: var(--s-3); + margin: 0; } -.kpi { - padding: 14px var(--s-4); +.num { + display: flex; + flex-direction: column-reverse; + justify-content: flex-end; + gap: 2px; + min-width: 0; + padding: 10px var(--s-3); background: var(--bg-2); border: 1px solid var(--line-1); border-radius: var(--r-3); - min-width: 0; -} -.kpi--root { - grid-column: 1 / -1; } -.kpi-k { - font-size: var(--fs-11); - font-weight: 600; - letter-spacing: 0.06em; - text-transform: uppercase; +.num dt { + font-size: var(--fs-12); color: var(--fg-3); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } -.kpi-v { - display: flex; - align-items: center; - gap: 6px; - margin-top: 6px; - min-height: 32px; - font-size: var(--fs-26); +.num dd { + margin: 0; + font-size: var(--fs-22); font-weight: 600; letter-spacing: -0.02em; - line-height: 1.2; + line-height: 1.15; color: var(--fg-1); font-variant-numeric: tabular-nums; - transition: opacity var(--dur-enter) var(--ease-out); + white-space: nowrap; } -.kpi-v .hash { - font-size: var(--fs-16); +.num-of { + font-size: var(--fs-14); font-weight: 500; + color: var(--fg-3); + letter-spacing: 0; } -.kpi-sub { - margin-top: 2px; + +/* the case list */ +.live-list { + min-width: 0; +} +.live-head { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: var(--s-3); + margin-bottom: var(--s-2); +} +.live-h { + margin: 0; font-size: var(--fs-12); + font-weight: 600; + letter-spacing: 0.08em; + text-transform: uppercase; color: var(--fg-3); +} +.live-rows { + list-style: none; + margin: 0; + padding: 0; + display: grid; + gap: 6px; +} +a.case-row { + color: inherit; + text-decoration: none; +} +a.case-row.live-row { + gap: 4px; + padding: 10px 12px; +} +.live-row .case-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.kpi-unit { - font-size: var(--fs-14); - font-weight: 500; - color: var(--fg-3); - letter-spacing: 0; +.live-row .case-meta { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } -.kpi--living .kpi-v { - color: var(--ok); +a.case-row.is-unpublished { + border-style: dashed; } -.kpi--living .kpi-sub { - white-space: normal; +.case-row.is-hot { + background: var(--bg-3); + border-color: var(--line-2); } -@media (min-width: 760px) { - .kpis { - grid-template-columns: repeat(5, minmax(0, 1fr)); +.live-empty { + padding: var(--s-4); + color: var(--fg-3); + border: 1px dashed var(--line-2); + border-radius: var(--r-3); +} + +/* phone: map (≈40 % of the screen, pannable), numbers strip, then the list */ +@media (max-width: 899px) { + .live { + padding-top: var(--s-3); + gap: var(--s-3); } - .kpis--6 { - grid-template-columns: repeat(3, minmax(0, 1fr)); + .world-in { + width: max(100%, 80svh); + height: 40svh; + aspect-ratio: auto; } - .kpi--root { - grid-column: auto; + .num { + padding: 6px 10px; + } + .num dd { + font-size: var(--fs-18); + } + .num dt { + font-size: var(--fs-11); + white-space: normal; + line-height: 1.3; + } + .live-row .case-title { + white-space: normal; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; } -} -.global-value { - margin-top: var(--s-3); - margin-bottom: 0; - font-size: var(--fs-13); - color: var(--fg-2); -} -.global-value cite { - display: block; - margin-top: 2px; - font-size: var(--fs-11); - font-style: normal; - color: var(--fg-3); } -/* ---------------------------------------------------------------- bands */ +/* ---------------------------------------------------------------- landing: below the fold (compact strips) */ -.band { - padding-top: clamp(48px, 8vw, 88px); -} -.band-row { - display: flex; - align-items: baseline; - justify-content: space-between; - gap: var(--s-4); +.strip { + display: grid; + gap: var(--s-3); + margin-top: var(--s-8); + padding-top: var(--s-6); + border-top: 1px solid var(--line-1); } -.band-h { +.strip-h { margin: 0; - font-size: var(--fs-22); + font-size: var(--fs-16); font-weight: 600; - letter-spacing: -0.02em; + letter-spacing: -0.01em; color: var(--fg-1); } -.band-lede { - margin: var(--s-2) 0 0; - max-width: 64ch; +.strip-side { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: var(--s-3); +} +.strip-lede { + margin: 0 0 var(--s-2); + max-width: 72ch; color: var(--fg-2); text-wrap: pretty; } -.band-note { - margin: var(--s-5) 0 0; - font-size: var(--fs-13); - color: var(--fg-3); -} -.band h3 { - margin: 0; - font-size: var(--fs-14); - font-weight: 600; - color: var(--fg-1); -} -.band p { - text-wrap: pretty; +@media (min-width: 900px) { + .strip { + grid-template-columns: 240px minmax(0, 1fr); + gap: var(--s-6); + } + .strip-side { + flex-direction: column; + align-items: flex-start; + justify-content: flex-start; + gap: var(--s-2); + } } -/* pipeline */ -.pipeline { +/* how a case is made: one row of short labels */ +.flow { list-style: none; - margin: var(--s-6) 0 0; + margin: 0; padding: 0; display: grid; + grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-2); } -.pipeline li { - position: relative; - padding: var(--s-4); +.flow li { + display: grid; + grid-template-columns: auto minmax(0, 1fr); + column-gap: var(--s-2); + align-items: baseline; + padding: 10px var(--s-3); background: var(--bg-2); border: 1px solid var(--line-1); border-radius: var(--r-3); } -.pipeline p { - margin: 6px 0 0; - font-size: var(--fs-13); - line-height: 1.55; - color: var(--fg-2); +.flow b { + font-weight: 600; + color: var(--fg-1); } -.pipe-n { - display: block; - margin-bottom: var(--s-2); +.flow li > span:last-child { + grid-column: 2; + font-size: var(--fs-12); + color: var(--fg-3); +} +.flow-n { + grid-row: span 2; font-family: var(--font-mono); font-size: var(--fs-11); color: var(--accent); } -@media (min-width: 900px) { - .pipeline { - grid-template-columns: repeat(5, minmax(0, 1fr)); - } -} -/* latest cases */ -.case-grid { - display: grid; - gap: var(--s-2); - margin-top: var(--s-5); +/* world pulse — collapsed to its group headers (with tallies) until "Show all" */ +.card--static { + cursor: default; } -a.case-row { - color: inherit; - text-decoration: none; +.card--static:active { + transform: none; } -@media (min-width: 700px) { - .case-grid { - grid-template-columns: repeat(2, minmax(0, 1fr)); - } +#pulse.is-collapsed .tiles, +#pulse.is-collapsed .card-note { + display: none; } -@media (min-width: 1000px) { - .case-grid { - grid-template-columns: repeat(3, minmax(0, 1fr)); - } +#pulse.is-collapsed .tiles-group { + display: flex; + margin: 0; + padding: 8px 0; + border-top: 1px solid var(--line-1); } - -/* world pulse — the dashboard card, given room */ -#pulse { - margin-top: var(--s-5); +#pulse.is-collapsed .tiles-group:first-of-type { + border-top: 0; } -.card--static { - cursor: default; +.tiles-tally { + display: inline-flex; + gap: var(--s-3); + margin-left: auto; + font-size: var(--fs-11); + letter-spacing: 0; + text-transform: none; } -.card--static:active { - transform: none; +.tiles-group { + display: flex; + align-items: baseline; } @media (min-width: 700px) { #pulse .tiles { @@ -424,11 +547,37 @@ a.case-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } } +.global-value { + margin: var(--s-3) 0 0; + font-size: var(--fs-13); + color: var(--fg-2); +} +.global-value cite { + display: block; + margin-top: 2px; + font-size: var(--fs-11); + font-style: normal; + color: var(--fg-3); +} + +/* ---------------------------------------------------------------- inner pages: shared bits */ -/* verify steps */ +.band-lede { + margin: var(--s-2) 0 0; + max-width: 64ch; + color: var(--fg-2); + text-wrap: pretty; +} +.band-note { + margin: var(--s-5) 0 0; + font-size: var(--fs-13); + color: var(--fg-3); +} + +/* developers: verify steps + link list */ .steps-v { list-style: none; - margin: var(--s-6) 0 0; + margin: var(--s-3) 0 var(--s-4); padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); @@ -458,6 +607,12 @@ a.case-row { font-size: var(--fs-12); font-weight: 600; } +.steps-v h3 { + margin: 0; + font-size: var(--fs-14); + font-weight: 600; + color: var(--fg-1); +} .steps-v p { margin: 4px 0 0; font-size: var(--fs-13); @@ -466,28 +621,24 @@ a.case-row { .steps-v .cmdline { margin-top: var(--s-3); } - -/* challenge */ -.challenge-grid { +.dev-links { + list-style: none; + margin: 0; + padding: 0; display: grid; - gap: var(--s-5); - margin-top: var(--s-5); -} -.challenge-grid p { - margin: 6px 0 0; - color: var(--fg-2); -} -@media (min-width: 760px) { - .challenge-grid { - grid-template-columns: 1fr 1fr; - gap: var(--s-8); - } + gap: 6px; } -.challenge-actions { +.dev-links li { display: flex; flex-wrap: wrap; - gap: var(--s-2); - margin-top: var(--s-5); + gap: 4px var(--s-3); + font-size: var(--fs-13); +} +.dev-links .link { + font-family: var(--font-mono); +} +.dev-links span { + color: var(--fg-3); } /* ---------------------------------------------------------------- footer */ @@ -791,8 +942,79 @@ a.case-row > .case-top { overflow-wrap: anywhere; } -.challenge .challenge-actions { - margin-top: var(--s-3); +/* status words are plain sentences on the site ("Being checked"), not title-cased codes */ +.status-badge { + text-transform: none; +} + +/* case page: the plain top half */ +.case-head { + margin-top: var(--s-2); +} +.case-summary.narrative p:first-child { + margin-top: 0; +} +.plain-list { + margin: 0; + padding-left: 1.2em; + display: grid; + gap: 6px; + color: var(--fg-2); +} +.plain-list b { + color: var(--fg-1); + font-weight: 600; +} +.seen-when { + color: var(--fg-3); + white-space: nowrap; +} +.case-id { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--s-2); + margin: var(--s-3) 0 0; + font-size: var(--fs-12); + color: var(--fg-3); +} +.case-id code { + color: var(--fg-2); + overflow-wrap: anywhere; +} + +/* case page: technical details, closed by default */ +.tech { + margin-top: var(--s-8); + border-top: 1px solid var(--line-1); +} +.tech-sum { + display: flex; + align-items: baseline; + gap: var(--s-3); + padding: var(--s-4) 0; + cursor: pointer; + font-weight: 600; + color: var(--fg-1); + list-style: none; +} +.tech-sum::-webkit-details-marker { + display: none; +} +.tech-sum::before { + content: "›"; + display: inline-block; + width: 12px; + color: var(--fg-3); + transition: transform var(--dur-hover) var(--ease-out); +} +.tech[open] > .tech-sum::before { + transform: rotate(90deg); +} +.tech-sum span { + font-size: var(--fs-12); + font-weight: 400; + color: var(--fg-3); } @media (max-width: 760px) { @@ -802,16 +1024,26 @@ a.case-row > .case-top { .site-nav a { padding: 6px 8px; } - .hero-cta .btn { - flex: 1; +} + +/* landing header on a phone: wordmark + nav on one row, the sentence under it; not sticky */ +@media (max-width: 899px) { + .site-top--landing { + position: static; + height: auto; } - .hero-h br { - display: none; + .site-top--landing .site-top-in { + flex-wrap: wrap; + row-gap: 2px; + padding-top: 8px; + padding-bottom: 8px; } -} -@media (max-width: 480px) { - .site-nav .nav-opt { - display: none; + .site-top--landing .top-line { + order: 3; + flex-basis: 100%; + padding-left: 0; + border-left: 0; + font-size: var(--fs-12); } } @@ -871,10 +1103,15 @@ a.case-row > .case-top { } @media (prefers-reduced-motion: reduce) { - .dot-halo { + .pin--pub .pin-dot::after { animation: none; opacity: 0; } + .pin-dot, + .pin-tip, + .tech-sum::before { + transition: none; + } .check--wait .check-mark { animation: none; }